Example #1
0
 private void OnDestroy()
 {
     if (Singleton == this)
     {
         Singleton = null;
     }
 }
Example #2
0
 private void Start()
 {
     if (Singleton != null)
     {
         Destroy(gameObject);
         return;
     }
     Singleton = this;
 }