private void OnDestroy() { if (_instance == this) { _shuttingDown = true; _instance = null; } }
void Awake() { if (_instance != null) { Debug.LogWarning("Duplicate ExperimentManager!", this.gameObject); DestroyImmediate(this); return; } DontDestroyOnLoad(this); _instance = this; }