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; } }
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"); } }
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); }