Skip to content

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_nametypedescription
layer_indexnumberThe index of the layer.

reture

typedescription
AnimatorStateInfoAn object used to store the animation state information.

code example

typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.GetCurrentStateInfo(undefined);