void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "enemigo") { _score.SetPuntuacion(); if (_laserContainer._contador != 0) { _laserContainer._contador--; _laserContainer.C_contador(); } Destroy(this.gameObject); } if (coll.gameObject.tag == "Obstaculo") { Destroy(this.gameObject); } /**if (coll.gameObject.tag =="BalaE") { * Destroy(this.gameObject); * * }*/ }
void OnTriggerEnter2D(Collider2D sShot) { if (sShot.gameObject.tag == "enemigo") { _score.SetPuntuacion(); } }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.tag.Equals("bala")) { Destroy(coll.gameObject); } if (coll.gameObject.tag.Equals("enemigo")) { _score.SetPuntuacion(); Destroy(coll.gameObject); } if (coll.gameObject.tag.Equals("BalaE")) { Destroy(coll.gameObject); } }