void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Awake() { DontDestroyOnLoad(this.gameObject); if (instance1 == null) { instance1 = this; } else { Destroy(this.gameObject); } }