protected virtual void OnDestroy() { if (mInstance == this) { Exists = false; mInstance = null; } }
protected virtual void Awake() { if (mInstance == null) { mInstance = this; Exists = true; } else { if (mInstance != this) { Debug.LogWarning("Two Instance" + typeof(T).ToString()); Destroy(mInstance); mInstance = this; } } }