protected virtual void OnDestroy() { if (_instance == this) { _instance = null; } }
protected virtual void Awake() { if (_instance != null) { Debug.Log(string.Format("Multiple instances of script {0}!", GetType()), gameObject); Debug.Log("Other instance: " + _instance, _instance); } else { _instance = this; } }