AnimationState
extends EngineObject
The AnimationState class is used to manage the state and playback information of animation clips.
You can obtain an AnimationState object using the following method:
typescript
let go = new GameObject("Animation");
let anim = go.AddComponent<Animation>(Animation) as Animation;
let clip = Resources.Load<AnimationClip>(AnimationClip, "E5F0A8E2A8894F095DA73FD033B0AF07");
anim.AddClip(clip, "newClip");
let state = anim.GetState("newClip");成员变量
AnimationState.clip : AnimationClip|null |
| (Read Only) The default animation clip. |
AnimationState.weight : number |
| The weight of the animation. |
AnimationState.blendMode : AnimationBlendMode |
| The blend mode of the current animation state. |
AnimationState.enable : boolean |
| The enable state of the current animation. |
AnimationState.isActivated : boolean |
| (Read Only) Whether the current animation is active. |
AnimationState.layer : number |
| The layer in which the current animation is located. |
AnimationState.name : string |
| The name of the current animation. |
AnimationState.normalizedTime : number |
| (Read Only) The normalized time of the animation. |
AnimationState.normalizedSpeed : number |
| (Read Only) The normalized playback speed of the animation (commonly used to synchronize playback speed between two animations during blending). |
AnimationState.length : number |
| (Read Only) The length of the current animation clip in seconds. |
AnimationState.speed : number |
| The playback speed of the current animation. |
AnimationState.speedSync : number |
| (Read Only) The synchronized playback speed of the current animation. |
AnimationState.time : number |
| The current time of the animation. |
AnimationState.wrapMode : WrapMode |
| The looping mode of the current animation. |
AnimationState.normalizeSpeedSync : number |
| Standardized synchronization playback speed for animations. |
AnimationState.normalizeSpeed : number |
| The normalized playback speed of the animation (commonly used to synchronize playback speed between two animations when blending between them). |
AnimationState.normalizeTime : number |
| The normalized time of the animation. |
成员方法
AnimationState.Stop ( ) : void |
| Stops playing the animation. |
