Whether if crossFade()
or play()
has been called before this component starts.
Whether the default clip should get into playing when this components starts.
Note, this field takes no effect if crossFade()
or play()
has been called before this component starts.
Gets or sets clips this component governs. When set, associated animation state of each existing clip will be stopped. If the existing default clip is not in the set of new clips, default clip will be reset to null.
Gets or sets clips this component governs. When set, associated animation state of each existing clip will be stopped. If the existing default clip is not in the set of new clips, default clip will be reset to null.
Gets or sets the default clip.
Gets or sets the default clip.
添加一个动画剪辑到 this.clips
中并以此剪辑创建动画状态。
The animation clip
The animation state name, if absent, the default clip's name will be used
The created animation state
Creates a state for specified clip. If there is already a clip with same name, the existing animation state will be stopped and overridden.
The animation clip
The animation state name, if absent, the default clip's name will be used
The animation state created
Smoothly switch to play specified animation state.
The name of the animation to switch to
The duration of the cross fade, default value is 0.3s
Get specified animation state.
Get specified animation state.
The name of the animation
If no animation found, return null, otherwise the correspond animation state is returned
Unregister animation event callback.
The event type to unregister
The callback to unregister
Register animation event callback.
The event type to listen to
The callback when event triggered
The registered callback
Pause all animation states and all switching.
Switch to play specified animation state, without fading.
The name of the animation to be played, if absent, the default clip will be played
Remove clip from the animation list. This will remove the clip and any animation states based on it.
If there are animation states depend on the clip are playing or clip is defaultClip, it will not delete the clip.
But if force is true, then will always remove the clip and any animation states based on it. If clip is defaultClip,
defaultClip will be reset to null
If force is true, then will always remove the clip and any animation states based on it.
Stops and removes specified clip.
The name of the animation state
Resume all animation states and all switching.
Stop all animation states and all switching.
Generated using TypeDoc
Animation component governs a group of animation states to control playback of the states. For convenient, it stores a group of animation clips. Each of those clips would have an associated animation state uniquely created. Animation component is eventful, it dispatch a serials playback status events. See EventType.