private void Awake() { if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); }
private void OnDestroy() { _instance = null; SceneManager.sceneLoaded -= this.SceneManager_SceneLoaded; }