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

int

choices

public List<LegionUnit.Choice> choices

Field Value

List<LegionUnit.Choice>

code

public string code

Field Value

string

motionSet

public string motionSet

Field Value

string

version

public int version

Field Value

int

Methods

DyeFor(string)

public string DyeFor(string slot)

Parameters

slot string

Returns

string

OptionFor(string)

public string OptionFor(string slot)

Parameters

slot string

Returns

string

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

motion string
normalizedTime float

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)

Parameters

animator Animator
motion string
motionSet string

Returns

string