void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("Player")) { ControlVida vida = gameObject.GetComponent <ControlVida> (); vida.reset(); Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } } // fin de awake
void Awake() { if (ControlVida.instaciate == null) { ControlVida.instaciate = this; } else { Destroy(this.gameObject); } }