Exemplo n.º 1
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Enermy"))
     {
         if (this.onFire)
         {
             EnemyWithFire enemy = collision.gameObject.GetComponentInParent <EnemyWithFire> ();
             enemy.Burned();
         }
     }
 }
Exemplo n.º 2
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            Player player = collision.gameObject.GetComponent <Player> ();
            player.Hit(damage);
//			print ("enemy hit player");
            // maybe add attack animation
        }

        if (collision.gameObject.CompareTag("Enermy"))
        {
            if (this.onFire)
            {
                EnemyWithFire enemy = collision.gameObject.GetComponentInParent <EnemyWithFire> ();
                enemy.Burned();
            }
        }
    }