Browse Source

鸭子游戏引入bug修复

lvjincheng 3 years ago
parent
commit
0fa90cfa0d

+ 3 - 3
Assets/BowArrow/Prefabs/Views/Home/ChallengeOptionView.prefab

@@ -1608,10 +1608,10 @@ RectTransform:
   m_Father: {fileID: 4507770291199562698}
   m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0.5, y: 0.5}
-  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchorMin: {x: 0, y: 0.5}
+  m_AnchorMax: {x: 1, y: 0.5}
   m_AnchoredPosition: {x: 0, y: -50}
-  m_SizeDelta: {x: 1100, y: 0}
+  m_SizeDelta: {x: -180, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &27650411521148275
 MonoBehaviour:

+ 9 - 3
Assets/BowArrow/Scripts/Game/CameraToLook.cs

@@ -26,13 +26,19 @@ public class CameraToLook : MonoBehaviour
         }
         set 
         {
+            transform.localRotation = value;
             if (onlyParseRotation) {
                 //去掉z轴影响
                 Vector3 normalVector = value * Vector3.forward;
                 Quaternion normalQuat = Quaternion.LookRotation(normalVector);
-                onParseRotation?.Invoke(normalQuat);
-            } else {
-                transform.localRotation = value;
+                try
+                {
+                    onParseRotation?.Invoke(normalQuat);
+                }
+                catch (System.Exception e)
+                {
+                    Debug.LogError(e);
+                }
             }    
         }
     }

+ 1 - 1
Assets/DuckHunter/Scenes/DuckHunter.unity

@@ -3315,7 +3315,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -45, y: -25}
+  m_AnchoredPosition: {x: -45, y: -60}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 1, y: 1}
 --- !u!114 &1180745910

+ 1 - 0
Assets/DuckHunter/Scripts/SmartBowController.cs

@@ -12,6 +12,7 @@ namespace DuckHunter
         void Start() {
             Instance = this;
             SimulateMouseController.ins?.RemoveOpenLocker("NotGame");
+            CameraToLook.ins.onParseRotation += OnRotationUpdate;
         }
 
         void OnDestroy() {