Beispiel #1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.GetComponent <Attack>() != null)
     {
         print("headbutt!");
         DragonMain otherDragon = other.gameObject.GetComponent <DragonMain>();
         if ((dragon.isPlayer && !otherDragon.isPlayer) || (!dragon.isPlayer && otherDragon.isPlayer))
         {
             otherDragon.GetComponent <Attack>().GetHit((int)dragon.baseHornDamage);
         }
     }
 }