private void OnDestroy() { if (object.ReferenceEquals(sInstance, this)) { sInstance = null; SingletonMgr.RemoveSingleton(this); } }
static public void DestroySingleton() { if (sInstance != null) { SingletonMgr.RemoveSingleton(sInstance); Destroy(sInstance.gameObject); sInstance = null; } }