Exemple #1
0
 private void OnDestroy()
 {
     if (this == sInstance)
     {
         sInstance = null;
     }
 }
Exemple #2
0
 void Awake()
 {
     if (sInstance == null)
     {
         sInstance = this;
         Setup();
     }
     else if (sInstance != this)
     {
         Destroy(this.gameObject);
         return;
     }
 }