修改态势显示

This commit is contained in:
YangHua 2024-03-07 15:50:32 +08:00
parent 09d29f1446
commit 44b18c7d3e
3 changed files with 18 additions and 13 deletions

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1113159741}
m_IndirectSpecularColor: {r: 0.1623216, g: 0.30607828, b: 0.6689026, a: 1}
m_IndirectSpecularColor: {r: 0.16233939, g: 0.30609006, b: 0.66884065, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -48711,7 +48711,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000030517578}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &996536657
MonoBehaviour:
@ -68550,7 +68550,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1719983406
RectTransform:
m_ObjectHideFlags: 0
@ -68599,6 +68599,7 @@ MonoBehaviour:
distance: 0
isScale: 0
satelliteImagery: {fileID: 1378295488}
rect: {fileID: 6368481659655708048}
--- !u!1 &1720385560
GameObject:
m_ObjectHideFlags: 0
@ -68634,7 +68635,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000030517578}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &1720385562
MonoBehaviour:
@ -70680,7 +70681,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
randSeed: 667614828
randSeed: 683595140
isDoingTransition: 0
minimumHeight: 0
--- !u!114 &1820978574
@ -98960,7 +98961,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -948, y: 10}
m_Pivot: {x: 0, y: 1}
--- !u!114 &6368481658076565719
MonoBehaviour:
@ -100516,7 +100517,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -100825,9 +100826,9 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -7, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &6368481659665436127
MonoBehaviour:

View File

@ -27,6 +27,7 @@ public class PostureController : MonoBehaviour
public Camera satelliteImagery;
public Coroutine currentCoroutine;
public RectTransform rect;
// Start is called before the first frame update
void Awake()
@ -43,10 +44,13 @@ public class PostureController : MonoBehaviour
//if (EventSystem.current.IsPointerOverGameObject()) return;
if (Input.GetMouseButton(0))
{
float mouseX = Input.GetAxis("Mouse X") * 10f * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * 10f * Time.deltaTime;
satelliteImagery.transform.Translate(Vector3.down * mouseY * 60f);
satelliteImagery.transform.Translate(Vector3.left * mouseX * 60f);
if (RectTransformUtility.RectangleContainsScreenPoint(rect, Input.mousePosition))
{
float mouseX = Input.GetAxis("Mouse X") * 10f * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * 10f * Time.deltaTime;
satelliteImagery.transform.Translate(Vector3.down * mouseY * 60f);
satelliteImagery.transform.Translate(Vector3.left * mouseX * 60f);
}
}
}