示例#1
0
    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);
         *
         * }*/
    }
示例#2
0
 void OnTriggerEnter2D(Collider2D sShot)
 {
     if (sShot.gameObject.tag == "enemigo")
     {
         _score.SetPuntuacion();
     }
 }
示例#3
0
 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);
     }
 }