Class EnemyDamager
Used to damage an Enemy on contact
Namespace: WeaverCore.Assets.Components
Assembly: WeaverCore.dll
Syntax
public class EnemyDamager : MonoBehaviour
Fields
| Edit this page View SourceOnHitObject
Declaration
public UnityEvent<GameObject, float> OnHitObject
Field Value
| Type | Description |
|---|---|
| UnityEvent<GameObject, float> |
attackType
The type of attack on the enemy
Declaration
public AttackType attackType
Field Value
| Type | Description |
|---|---|
| AttackType |
damage
The amount of damage this will deal to the enemy
Declaration
public int damage
Field Value
| Type | Description |
|---|---|
| int |
hitDirection
In which direction is the attack going towards?
Declaration
public CardinalDirection hitDirection
Field Value
| Type | Description |
|---|---|
| CardinalDirection |
Methods
| Edit this page View SourceHitEnemy(Transform, GameObject, int, AttackType, CardinalDirection)
Hits a specified enemy
Declaration
public static List<IHittable> HitEnemy(Transform obj, GameObject attacker, int damage, AttackType type, CardinalDirection hitDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | obj | The transform of the enemy to hit |
| GameObject | attacker | The GameObject initiating the attack. |
| int | damage | The amount of damage to be dealt. |
| AttackType | type | The type of attack. |
| CardinalDirection | hitDirection | The cardinal direction of the attack. |
Returns
| Type | Description |
|---|---|
| List<IHittable> | A list of IHittable objects that were successfully hit. |