Class LegionEvents
- Namespace
- PixelUnitStudio
- Assembly
- PixelUnitStudio.Runtime.dll
Receives events from motion clips. Attached to a hero root with an Animator (saved prefabs, heroes assembled with LegionBuilder). hit: the moment an attack lands (the moment a bow, crossbow or gun fires, or a thrown weapon leaves the hand), cast: the moment a cast goes out, end: end of a one-shot motion. The argument is the animator state name (attack, attack@spear, etc.).
public sealed class LegionEvents : MonoBehaviour
- Inheritance
-
LegionEvents
Constructors
LegionEvents()
public LegionEvents()
Fields
Cast
public const string Cast = "cast"
Field Value
End
public const string End = "end"
Field Value
Hit
public const string Hit = "hit"
Field Value
onCast
public UnityEvent onCast
Field Value
- UnityEvent
onEnd
public UnityEvent onEnd
Field Value
- UnityEvent
onHit
public UnityEvent onHit
Field Value
- UnityEvent
returnToIdle
public bool returnToIdle
Field Value
Properties
WeaponBone
Back-hand weapon bone. Used as the position where projectiles spawn (LegionProjectile).
public Transform WeaponBone { get; }
Property Value
- Transform
Methods
FunctionOf(string)
Function name called by clip events (LegionAnimation puts it in the clip).
public static string FunctionOf(string eventName)
Parameters
eventNamestring
Returns
Events
Fired
Event name (hit, cast, end) and state name.
public event Action<string, string> Fired