|
|
@@ -20,6 +20,7 @@ public class DeviceCalibrateView : MonoBehaviour
|
|
|
};
|
|
|
int guideIndex = 0;
|
|
|
public bool guide = true;
|
|
|
+ public static DeviceCalibrateView ins;
|
|
|
|
|
|
public static void Create(DeviceCalibrateItem itemType = DeviceCalibrateItem.Guide) {
|
|
|
GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/DeviceCalibrateView"));
|
|
|
@@ -28,6 +29,7 @@ public class DeviceCalibrateView : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
void Awake() {
|
|
|
+ ins = this;
|
|
|
try {
|
|
|
GlobalEventCenter.ins.onDeviceCalibrateViewAwakeChanged?.Invoke(true);
|
|
|
} catch (System.Exception e) { Debug.LogError(e.Message); }
|
|
|
@@ -78,6 +80,7 @@ public class DeviceCalibrateView : MonoBehaviour
|
|
|
|
|
|
void OnDestroy()
|
|
|
{
|
|
|
+ if (ins == this) ins = null;
|
|
|
try {
|
|
|
GlobalEventCenter.ins.onDeviceCalibrateViewAwakeChanged?.Invoke(false);
|
|
|
} catch (System.Exception e) { Debug.LogError(e.Message); }
|
|
|
@@ -168,7 +171,7 @@ public class DeviceCalibrateView : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//重置地磁校准超时检测
|
|
|
- void ResetCalibrateMagTimeout() {
|
|
|
+ public void ResetCalibrateMagTimeout() {
|
|
|
calibrateMagStartTime = Time.realtimeSinceStartup;
|
|
|
calibrateMagTimeoutTipShowed = false;
|
|
|
}
|