#region Singleton void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); } #endregion
void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); }