Example #1
0
 // Start is called before the first frame update
 void Awake()
 {
     if (objeto == null)
     {
         objeto = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         if (objeto != null)
         {
             Destroy(this);
         }
     }
 }
Example #2
0
 private void Awake()
 {
     objetoIndes = GameObject.Find("objetoindestruible").GetComponent <ObjetoEsenas>();
 }