Skip to content

format

typescript
Animation.PlayQueued(name, queue_mode, mode)

class: Animation

description

Add an animation clip named 'name' to the animation play list and play it after the current animation clip finishes playing.

It allows you to automatically play the next animation after the current animation finishes, achieving seamless animation transitions.

parameter

param_nametypedescription
namestringThe name of the animation clip.
queue_modeAnimationQueueModeThe queue play mode that defines the behavior of the animation queue. The default value is AnimationQueueMode.CompleteOthers.
modeAnimationPlayModeThe animation play mode that defines the overlay behavior of the animation. The default value is AnimationPlayMode.StopSameLayer.

reture

typedescription
void

code example

typescript
let obj = new GameObject();
let animation = obj.AddComponent<Animation>(Animation);
animation.PlayQueued("clip_name", AnimationQueueMode.PlayNow, AnimationPlayMode.StopAll);