Skip to content

format

typescript
AnimatorStateInfo.IsName(name)

class: AnimatorStateInfo

description

Checks if the current name matches the name of the active state in the state machine.

parameter

param_nametypedescription
namestringThe current name.

reture

typedescription
booleanTrue if the name matches, false otherwise.

code example

typeScript
let go = new GameObject("StateInfo");
let animator = go.AddComponent<Animator>(Animator);
let data = Resources.Load<AnimatorData>(AnimatorData, "461E6F10246D4A0638921370728F3D10");
let stateInfo = actor.GetCurrentStateInfo(0);
stateInfo.IsName("name");