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