protected virtual void HurtHurtbox(HitboxGroup hitboxGroup, int hitboxIndex, Hurtbox hurtbox, GameObject attacker) { HitReactionBase reaction = hurtbox.Hurtable.Hurt(BuildHurtInfo(hitboxGroup, hitboxIndex, hurtbox, attacker)); OnHitHurtbox?.Invoke(hitboxGroup, hitboxIndex, hurtbox, reaction); }
protected virtual HurtInfoBase BuildHurtInfo(HitboxGroup hitboxGroup, int hitboxIndex, Hurtbox hurtbox, GameObject attacker) { return(new HurtInfoBase()); }
/// <summary> /// Determines if this hurtbox should be hit. /// </summary> /// <param name="hitboxGroup">The hitbox group of the hitbox.</param> /// <param name="hitboxIndex">The index of the hitbox.</param> /// <param name="hurtbox">The hurtbox that was hit.</param> /// <returns>If the hurtbox should be hurt.</returns> protected virtual bool ShouldHurt(HitboxGroup hitboxGroup, int hitboxIndex, Hurtbox hurtbox) { return(true); }