Пример #1
0
 public void collisionedWith(Collider2D collider)
 {
     if (CanHit)
     {
         Hurtbox hurtbox = collider.GetComponent <Hurtbox>();
         if (hurtbox.CheckIfGuarding())
         {
             hurtbox?.getHitBy((damage / 5), 0, "parry");
         }
         else
         {
             hurtbox?.getHitBy(damage, stunTime, "heavy");
         }
         CanHit = false;
     }
 }
Пример #2
0
    public void collisionedWith(Collider2D collider)
    {
        if (CanHit)
        {
            Hurtbox hurtbox = collider.GetComponent <Hurtbox>();
            if (hurtbox.CheckIfGuarding())
            {
                hurtbox?.getHitBy((damage / 5), 0, "parry");
            }
            else
            {
                hurtbox?.getHitBy(damage, stunTime, "light");
            }
            CanHit = false;

            //GetComponent<SoundEffects>().PlaySound("punch");
        }
    }
Пример #3
0
    public void collisionedWith(Collider2D collider)
    {
        Hurtbox hurtbox = collider.GetComponent <Hurtbox>();

        if (hurtbox.GetComponentInParent <Hadouken>() != null)
        {
            Destroy(hurtbox.gameObject.transform.parent.gameObject);
            Destroy(gameObject);
            PlaySound("Parry");
            return;
        }
        if (hurtbox.CheckIfGuarding())
        {
            hurtbox?.getHitBy((damage / 5), 0, "parry");
        }
        else
        {
            hurtbox?.getHitBy(damage, stunTime, "light");
        }

        Destroy(gameObject);
    }