Class LegionActionPlayer
- Namespace
- PixelUnitStudio
- Assembly
- PixelUnitStudio.Runtime.dll
Plays custom actions (LegionAction) on a hero: each step's motion in turn, then back to idle (an action ending in death stays down). Saved hero prefabs carry one that references the action library of their save folder; heroes assembled with LegionBuilder get one from Builder.Actions. While an action plays, LegionEvents.returnToIdle waits for the action to finish. Hit and cast events still fire for every step.
public sealed class LegionActionPlayer : MonoBehaviour
- Inheritance
-
LegionActionPlayer
Constructors
LegionActionPlayer()
public LegionActionPlayer()
Fields
ChannelStart
Starting a channel moves on to its loop by itself, so this step counts loops instead of restarting.
public const string ChannelStart = "cast_start"
Field Value
Death
public const string Death = "death"
Field Value
Idle
public const string Idle = "idle"
Field Value
library
public LegionActionLibrary library
Field Value
Properties
Current
public LegionAction Current { get; }
Property Value
IsPlaying
public bool IsPlaying { get; }
Property Value
StepIndex
public int StepIndex { get; }
Property Value
Methods
Advance()
Moves to the next repeat or step when the current motion has finished. Runs every frame; call it after Animator.Update when stepping by hand.
public void Advance()
Play(LegionAction)
public void Play(LegionAction action)
Parameters
actionLegionAction
Play(string)
Plays an action from the library by name. False if the library has no such action.
public bool Play(string actionName)
Parameters
actionNamestring
Returns
Stop()
Stops the action and leaves the current motion playing.
public void Stop()
Events
Finished
Action that finished playing.
public event Action<LegionAction> Finished
Event Type
StepStarted
Action and the index of the step that just started.
public event Action<LegionAction, int> StepStarted