private void Awake() { if (_SoundManager.instance == null) { _SoundManager.instance = this; } else if (_SoundManager.instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; //DontDestroyOnLoad(this); } }
void Singleton() { if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }