private void Awake() { if (instance) { DestroyImmediate(this.gameObject); } else { DontDestroyOnLoad(this.gameObject); instance = this; } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); //PlayerPrefs.DeleteAll(); }