Show / Hide Table of Contents

Class EnemyDamager

Used to damage an Enemy on contact

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
EnemyDamager
Namespace: WeaverCore.Assets.Components
Assembly: WeaverCore.dll
Syntax
public class EnemyDamager : MonoBehaviour

Fields

| Edit this page View Source

OnHitObject

Declaration
public UnityEvent<GameObject, float> OnHitObject
Field Value
Type Description
UnityEvent<GameObject, float>
| Edit this page View Source

attackType

The type of attack on the enemy

Declaration
public AttackType attackType
Field Value
Type Description
AttackType
| Edit this page View Source

damage

The amount of damage this will deal to the enemy

Declaration
public int damage
Field Value
Type Description
int
| Edit this page View Source

hitDirection

In which direction is the attack going towards?

Declaration
public CardinalDirection hitDirection
Field Value
Type Description
CardinalDirection

Methods

| Edit this page View Source

HitEnemy(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.

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾