跳转到内容

动画组件

下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 Details 面板读的那一份—— 所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲怎么用的正文在 每条目所链接的指南里。字段说明取自 C++ ES_PROPERTY 处的原文,因此为英文。

Animator

Runs an animator controller — states, transitions and blend trees — over the entity.

Explained in animation/overview.

FieldTypeDefaultNotes
controllerAsset<animatorcontroller>none
currentStatestringempty
enabledbooleantrue

DragonBonesAnimation

A DragonBones armature: its skeleton and atlas assets, armature choice and playback state.

Explained in animation/dragonbones.

FieldTypeDefaultNotes
skeletonPathstringempty
atlasPathstringempty
armatureenum (dragonbonesArmatures)empty
animationenum (dragonbonesAnimations)empty
timeScalenumber1 Range ≥ 0.
loopbooleantrue
playingbooleantrue
fadeInTimenumber0 Range ≥ 0, step 0.05.
flipXbooleanfalse
flipYbooleanfalse
colorColor#ffffff
layerenum (sortingLayers)0 Range step 1.
skeletonScalenumber1 Range ≥ 0.
materialAsset<material>none
enabledbooleantrue

SpineAnimation

A Spine skeleton: its skeleton and atlas assets, current animation, skin and mix settings.

Explained in animation/spine.

FieldTypeDefaultNotes
skeletonPathstringempty
atlasPathstringempty
skinenum (spineSkins)empty
animationenum (spineAnimations)empty
timeScalenumber1 Range ≥ 0.
loopbooleantrue
playingbooleantrue
flipXbooleanfalse
flipYbooleanfalse
colorColor#ffffff
layerenum (sortingLayers)0 Range step 1.
skeletonScalenumber1 Range ≥ 0.
materialAsset<material>none
enabledbooleantrue

SpriteAnimator

Plays a flipbook clip by swapping the sprite frame, with speed, looping and frame events.

Explained in animation/overview.

FieldTypeDefaultNotes
clipAsset<anim-clip>none
speednumber1
playingbooleantrue
loopbooleantrue
enabledbooleantrue
currentFramenumber0
frameTimernumber0
finishedbooleanfalse

TimelinePlayer

Plays a timeline asset — keyframed tracks across many entities — with wrap modes and playback control.

Explained in animation/timeline.

FieldTypeDefaultNotes
timelineAsset<timeline>none
playingbooleanfalse
speednumber1
wrapModestring"once"
finishedbooleanfalseClip completed (runtime, read-only). Raise Playing to replay.