Compare commits
3 Commits
442758cd05
...
1445fb76e0
| Author | SHA1 | Date |
|---|---|---|
|
|
1445fb76e0 | |
|
|
66274c1bc0 | |
|
|
12e0809d4d |
|
|
@ -38,7 +38,7 @@ RenderSettings:
|
|||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 1113159741}
|
||||
m_IndirectSpecularColor: {r: 0.16232353, g: 0.30599368, b: 0.66842777, a: 1}
|
||||
m_IndirectSpecularColor: {r: 0.017637905, g: 0.031211179, b: 0.06785975, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
|
|
@ -48488,7 +48488,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: 50}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &996536657
|
||||
MonoBehaviour:
|
||||
|
|
@ -53144,11 +53144,11 @@ Camera:
|
|||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
near clip plane: 0
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 1179
|
||||
orthographic size: 1120
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
|
|
@ -65517,6 +65517,16 @@ PrefabInstance:
|
|||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1561597386300646505, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1690237338199029568, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1693121673111326432, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
|
|
@ -65537,6 +65547,16 @@ PrefabInstance:
|
|||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2927603212027581197, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3410451424682802294, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3691389793902075663, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
|
|
@ -65547,6 +65567,11 @@ PrefabInstance:
|
|||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4239324281361100925, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4655910692261985928, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
|
|
@ -65692,6 +65717,16 @@ PrefabInstance:
|
|||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8101603123472128701, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8297275301161124839, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8589009349407657109, guid: c3d92615a09597d46aa740923029c15d,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
|
|
@ -67752,7 +67787,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1719983406
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -67796,6 +67831,11 @@ MonoBehaviour:
|
|||
type: 3}
|
||||
redShowImage: {fileID: 628155341}
|
||||
blueShowImage: {fileID: 338894529}
|
||||
upBtn: {fileID: 6368481658342163396}
|
||||
downBtn: {fileID: 6368481659336096937}
|
||||
distance: 0
|
||||
isScale: 0
|
||||
satelliteImagery: {fileID: 1378295488}
|
||||
--- !u!1 &1720385560
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -67831,7 +67871,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: 50}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &1720385562
|
||||
MonoBehaviour:
|
||||
|
|
@ -69758,7 +69798,7 @@ MonoBehaviour:
|
|||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
randSeed: 473439734
|
||||
randSeed: 401617593
|
||||
isDoingTransition: 0
|
||||
minimumHeight: 0
|
||||
--- !u!114 &1820978574
|
||||
|
|
@ -97919,7 +97959,7 @@ RectTransform:
|
|||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -948, y: 10}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &6368481658076565719
|
||||
MonoBehaviour:
|
||||
|
|
@ -98062,7 +98102,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6368481658342163399
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -99056,7 +99096,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &6368481659336096942
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -99475,7 +99515,7 @@ RectTransform:
|
|||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 20, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
|
|
@ -99784,9 +99824,9 @@ RectTransform:
|
|||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -7, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &6368481659665436127
|
||||
MonoBehaviour:
|
||||
|
|
|
|||
|
|
@ -16,21 +16,99 @@ public class PostureController : MonoBehaviour
|
|||
public RawImage blueShowImage;
|
||||
private DroneViewDisplay droneViewDisplay;
|
||||
|
||||
public Button upBtn;
|
||||
public Button downBtn;
|
||||
public float distance;
|
||||
public bool isScale = false;
|
||||
/// <summary>
|
||||
/// 卫星影像
|
||||
/// </summary>
|
||||
public Camera satelliteImagery;
|
||||
|
||||
public Coroutine currentCoroutine;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
deviceManager = DeviceManager.Instance;
|
||||
droneViewDisplay = DroneViewDisplay.Instance;
|
||||
upBtn.onClick.AddListener(OnUp);
|
||||
downBtn.onClick.AddListener(OnDown);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUp()
|
||||
{
|
||||
distance = satelliteImagery.orthographicSize;
|
||||
distance += 100;
|
||||
if (distance >= 1120)
|
||||
{
|
||||
distance = 1120;
|
||||
currentCoroutine = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentCoroutine == null)
|
||||
{
|
||||
isScale = true;
|
||||
currentCoroutine = StartCoroutine(Merge(distance));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDown()
|
||||
{
|
||||
distance = satelliteImagery.orthographicSize;
|
||||
distance -= 100;
|
||||
if (distance <= 200f)
|
||||
{
|
||||
distance = 200f;
|
||||
currentCoroutine = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentCoroutine == null)
|
||||
{
|
||||
isScale = true;
|
||||
currentCoroutine = StartCoroutine(Merge(distance));
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Merge(float targetPoint)
|
||||
{
|
||||
while (isScale)
|
||||
{
|
||||
Debug.Log("update");
|
||||
satelliteImagery.orthographicSize = Mathf.Lerp(satelliteImagery.orthographicSize, targetPoint, Time.deltaTime * 20f);
|
||||
if (Mathf.Abs(targetPoint - satelliteImagery.orthographicSize) < 0.1)
|
||||
{
|
||||
isScale = false;
|
||||
currentCoroutine = null;
|
||||
}
|
||||
yield return new WaitForSeconds(0.01f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (currentCoroutine != null)
|
||||
{
|
||||
currentCoroutine = null;
|
||||
}
|
||||
redShowImage.transform.parent.gameObject.SetActive(false);
|
||||
blueShowImage.transform.parent.gameObject.SetActive(false);
|
||||
GetSceneInfo();
|
||||
|
|
|
|||
Loading…
Reference in New Issue