Exemplo n.º 1
0
 /// <summary>
 ///
 /// if the player enters the enemies attack range we then attack them
 /// the attack range for melee attacks is dictated through using collider triggers
 ///
 /// <para> Author: Callum Dunstone </para>
 ///
 /// </summary>
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         meleeAttack.AttackPlayer();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// this is used to check if the player has moved into attack range of the ghost
 ///
 /// <para>Author: Callum Dunstone</para>
 ///
 /// </summary>
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         animat.SetBool("Attack", true);
         meleeAttack.AttackPlayer();
     }
 }