void Awake() { if (_instance == null) { _instance = this; //we're probably creating a new object after having explicitly destroyed, so reset. _destroyed = false; DontDestroyOnLoad(this); } if (_instance != this) Destroy(this); }
void Awake() { if (_instance == null) { _instance = this; //we're probably creating a new object after having explicitly destroyed, so reset. _destroyed = false; DontDestroyOnLoad(this); } if (_instance != this) { Destroy(this); } }