private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         UnityEngine.Object.Destroy(this);
         return;
     }
     this.Setup();
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         if (instance != this)
         {
             Destroy(this); // remove self, but don't destroy the gameobject its attached to. i.e. don't kill the host object.
             return;
         }
     }
     Setup();
 }
Ejemplo n.º 3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         if (instance != this)
         {
             Destroy(this); // remove self, but don't destroy the gameobject its attached to. i.e. don't kill the host object.
             return;
         }
     }
     Setup();
 }
Ejemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
             return;
         }
     }
     Setup();
 }
Ejemplo n.º 5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
             return;
         }
     }
     Setup();
 }