Class LegionUnit
- Namespace
- PixelUnitStudio
- Assembly
- PixelUnitStudio.Runtime.dll
Record attached to the root of a saved hero prefab. Keeps the option name and dye chosen per slot so it can be loaded again. Stored by name, so it is found correctly even if the catalog is rebuilt and the order changes.
public sealed class LegionUnit : MonoBehaviour
- Inheritance
-
LegionUnit
Constructors
LegionUnit()
public LegionUnit()
Fields
CurrentVersion
public const int CurrentVersion = 1
Field Value
choices
public List<LegionUnit.Choice> choices
Field Value
code
public string code
Field Value
motionSet
public string motionSet
Field Value
version
public int version
Field Value
Methods
DyeFor(string)
public string DyeFor(string slot)
Parameters
slotstring
Returns
OptionFor(string)
public string OptionFor(string slot)
Parameters
slotstring
Returns
Play(string, float)
Plays a motion in game. motion is one of idle, running, attack, damaged, death, cast, stun. For a long skill, playing cast_start ends and moves on to cast_loop by itself and repeats; play cast_end when the skill ends. If a state matching the weapon type (motion@motionSet) exists, it is played; otherwise the default motion.
public void Play(string motion, float normalizedTime = 0)
Parameters
StateFor(Animator, string, string)
Animator state for a motion with a weapon type's pose set: motion@motionSet if the controller has it, otherwise the default motion.
public static string StateFor(Animator animator, string motion, string motionSet)