Skip to content

format

typescript
Animation.GetState(name)

class: Animation

description

Get the animation state of the animation clip named "name".

parameter

param_nametypedescription
namestringThe name of the animation clip.

reture

typedescription
AnimationStateThe animation state.

code example

typescript
let animation = obj.AddComponent<Animation>(Animation);
let uuid = "31A9092E126B4B19BBFD9D5FCD75AA49";
let clip = Resources.Load<AnimationClip>(AnimationClip, uuid);
animation.AddClip(clip,"newClip");
animation.GetState("newClip");