Example #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag.Equals("Player"))
     {
         ControlVida vida = gameObject.GetComponent <ControlVida> ();
         vida.reset();
         Destroy(gameObject);
     }
 }
Example #2
0
    // Use this for initialization

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }    // fin de awake
Example #3
0
 void Awake()
 {
     if (ControlVida.instaciate == null)
     {
         ControlVida.instaciate = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }