void Awake() { if (instance == null) { instance = this; } else if (instance != this) { DestroyImmediate(this.gameObject); return; } DontDestroyOnLoad(gameObject); }
void Awake() { if (debug) { PlayerPrefs.DeleteAll(); } if (instance == null) { instance = this; } else if (instance != this) { DestroyImmediate(this.gameObject); return; } }
void Awake() { #if UNITY_EDITOR if (debugInEditor) { PlayerPrefs.DeleteAll(); } #endif if (instance == null) { instance = this; } else if (instance != this) { DestroyImmediate(this.gameObject); return; } }