void Awake() { if (instance == null) { instance = this; return; } Destroy(gameObject); }
void MakeSingleton() { if (instance != null) { Destroy(gameObject); } instance = this; DontDestroyOnLoad(gameObject); }
void Awake() { if (i == null) { i = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; DontDestroyOnLoad(this.gameObject); } }