Ejemplo n.º 1
0
 private void OnDestroy()
 {
     if (Singleton == this)
     {
         Singleton = null;
     }
 }
Ejemplo n.º 2
0
 private void Start()
 {
     if (Singleton != null)
     {
         Destroy(gameObject);
         return;
     }
     Singleton = this;
 }