Exemplo n.º 1
0
 private void CheckCollider(Collider c, bool isStay)
 {
     if (c.tag == enemy)
     {
         SwordController sword = c.GetComponent <SwordController>();
         if (sword)
         {
             if (sword.isAttacking && !sword.SetHit(this))
             {
                 TakeDamage(2);
             }
         }
         else if (!isStay)                   //Only sword attacks are valid for OnTriggerStay
         {
             TakeDamage(2);
         }
     }
 }