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