lvjincheng 4 vuotta sitten
vanhempi
sitoutus
d4dbd293a7

+ 10 - 2
Assets/BowArrow/Scripts/Game/ArmBow.cs

@@ -42,11 +42,19 @@ public class ArmBow : MonoBehaviour
     Quaternion[] cameraRotations = new Quaternion[6];
     int cameraRotationHasRecordCount = 0;
 
-    public static ArmBow ins;
+    private static ArmBow _ins;
+    public static ArmBow ins {
+        get {
+            if (!_ins) {
+                _ins = GameObject.FindObjectOfType<ArmBow>();
+            }
+            return _ins;
+        }
+    }
 
     void Awake()
     {
-        ins = this;
+        _ins = this;
         //initdata
         int currentShootLevel = LoginMgr.myUserInfo.shootLevel;
         shootBackTime = new int[]{0, 2, 5}[currentShootLevel];

+ 10 - 2
Assets/BowArrow/Scripts/Game/BowCamera.cs

@@ -28,10 +28,18 @@ public class BowCamera : MonoBehaviour
     public static bool isTouchMode = true;
     //禁止弓镜头被用户输入控制
     [NonSerialized] public bool banUserControl = false;
-    public static BowCamera ins;
+    private static BowCamera _ins;
+    public static BowCamera ins {
+        get {
+            if (!_ins) {
+                _ins = GameObject.FindObjectOfType<BowCamera>();
+            }
+            return _ins;
+        }
+    }
 
     void Awake() {
-        ins = this;
+        _ins = this;
         localEulerAngles = transform.localEulerAngles;
     }