// Support recompile and reset the singleton instance. #if UNITY_EDITOR void Update() { if (_instance == null) { _instance = this; } }
/** * Set the singleton instance as well as deactivating if the game just started. */ void Awake() { _instance = this; }