diff --git a/Assets/Scenes/TyDrone.unity b/Assets/Scenes/TyDrone.unity index 0250378..c10dd66 100644 --- a/Assets/Scenes/TyDrone.unity +++ b/Assets/Scenes/TyDrone.unity @@ -17137,10 +17137,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2a34776537bb1074a961d3d90ec1b386, type: 3} m_Name: m_EditorClassIdentifier: - stickController: {fileID: 0} - enabledAutoRotation: 0 - lastValue: 0 - turntable: {fileID: 1079683939} --- !u!1 &924872653 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/CockpitStickController.cs b/Assets/Scripts/CockpitStickController.cs index 1a7eb1d..8b875f2 100644 --- a/Assets/Scripts/CockpitStickController.cs +++ b/Assets/Scripts/CockpitStickController.cs @@ -94,6 +94,7 @@ private void UpdateCommand() rx = ToStickValue(tello.localPosition.x); ry = ToStickValue(tello.localPosition.z); ly = ToStickValue(tello.localPosition.y); + ly = ly < 0f ? ly * 1.5f : ly; } else { diff --git a/Assets/Scripts/Turntable.cs b/Assets/Scripts/Turntable.cs index 5980d50..68fe3e7 100644 --- a/Assets/Scripts/Turntable.cs +++ b/Assets/Scripts/Turntable.cs @@ -58,16 +58,17 @@ private void Update() return; } - var currentY = Mathf.RoundToInt(transform.rotation.eulerAngles.y); + var currentY = Normalize(Mathf.RoundToInt(transform.rotation.eulerAngles.y)); if (target != int.MaxValue) { - if (IsSame(target, currentY)) + if (target == currentY) { target = int.MaxValue; return; } - transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(0f, target, 0f), 0.5f); + var speed = Mathf.Abs(target - currentY) > 30f ? 10f : 1f; + transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(0f, target, 0f), speed); return; } @@ -86,7 +87,7 @@ private void Update() if (yaw != currentY) { - target = yaw; + target = Normalize(yaw); } } } @@ -101,17 +102,6 @@ public void UpdateOffset(float y) offset = Mathf.RoundToInt(y); } - private bool IsSame(int a, int b) - { - if (a == b) - { - return true; - } - - return Normalize(a) == Normalize(b); - - } - private int Normalize(int a) { a = a % 360; diff --git a/Assets/Scripts/VideoContainerDisplayPositions.cs b/Assets/Scripts/VideoContainerDisplayPositions.cs index 52b6fa9..04b763f 100644 --- a/Assets/Scripts/VideoContainerDisplayPositions.cs +++ b/Assets/Scripts/VideoContainerDisplayPositions.cs @@ -20,7 +20,7 @@ private void Start() public void Center() { - UpdateScale(4f); + UpdateScale(5f); Move(0f, 0f); } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 7550d19..81de47a 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -499,9 +499,6 @@ PlayerSettings: - {fileID: 0} - {fileID: 0} - {fileID: 0} - - {fileID: 11400000, guid: ab1b67dce0e107d458b7b6b5891213f5, type: 2} - - {fileID: 8820259372407401362, guid: 2250a865e36e4924bb482924a874ccb3, type: 2} - - {fileID: 7794255540170302434, guid: a0d9e1d8f1252fb44ac718c00197f71e, type: 2} - {fileID: 11400000, guid: 1898d77cb101c3d4e828c778684076a5, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0