format
typescript
Animator.GetCurrentStateInfo(layer_index)class: Animator
description
Get the current state information of an animation in the specified layer and store it in the target animation state information object.
parameter
| param_name | type | description |
|---|---|---|
| layer_index | number | The index of the layer. |
reture
| type | description |
|---|---|
AnimatorStateInfo | An object used to store the animation state information. |
code example
typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.GetCurrentStateInfo(undefined);