void OnDestroy() { if (Instance == this) { Instance = null; } StopAllCoroutines(); }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else { DestroyImmediate(gameObject); } }