An interface to handle calls from Melee Combat System.

Use this interface when you want to call a method when an object is hit by the attacker, for things such as a health script ,destroying an object on hit and any sort of custom on-hit behavior.

Note - there must be a script with this interface in the target GameObject to avoid errors.

Data Type

DamageType (enum)

Based on the reaction you want to trigger in Reaction Module, select one of the following.

Normal - trigger Hit Reaction in Reaction Module.

Parried - trigger Parry Reaction in Reaction Module.

Variables:

    int AttackId{get;set;}

Internally handled do not modify manually.

An internal variable, used to assign a unique ID to each attack instance to make sure no duplicate calls are made to the same GameObject even with overlapping colliders. ****

Methods

    void TakeDamage(MeleeCombatSystem meleeCombatSystem,DamageType damageType,Attack attack);

Default method used by Melee Combat System when a target collider is hit. Use this method to assign your custom function that should take place on impact.

meleeCombatSystem (MeleeCombatSystem) - reference to melee combat system of attacker.

damageType (DamageType) - an enum to separate a normal attack with a parry.

attack (Attack) - reference to an attack for which you want target to react.


    void TakeDamage(MeleeCombatSystem meleeCombatSystem);

Overload for TakeDamage