Esempio n. 1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Bullet")
     {
         bullet = other.gameObject.GetComponent <BulletMoveFoward>();
         TakeDamage(bullet.damage);
     }
 }
Esempio n. 2
0
    void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.tag == "Bullet")
        {
            enemyAudio.Play();
            bullet = other.gameObject.GetComponent <BulletMoveFoward>();
            TakeDamage(bullet.damage);

            //anim.SetTrigger("Hit");
        }
    }