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_name | type | description |
|---|---|---|
| name | string | The current name. |
reture
| type | description |
|---|---|
boolean | True 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");