跳转到内容

动画组件

下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 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
avatarAsset<avatar>none
currentStatestringempty
layerStatesarrayempty
enabledbooleantrue

AnimatorRootMotion

Publishes how far the active animation asks the character to move, for gameplay to hand to a character controller — a request, never a result.

Explained in animation/overview.

FieldTypeDefaultNotes
enabledbooleantrue
activebooleanfalse Read-only — the engine computes it.
deltaPositionVec3(0, 0, 0) Read-only — the engine computes it.
deltaRotationQuat(0, 0, 0, 1) Read-only — the engine computes it.
deltaTimenumber0 Read-only — the engine computes it.

AnimatorSpritePlaybacktransient

Tracks the sprite clip requested by the active animator state and its playback position when the entity has no Sprite Animator. The state machine recreates this component at runtime.

Explained in animation/overview.

FieldTypeDefaultNotes
playerunknown—
requestedbooleanfalse
restartbooleanfalse
speednumber1
loopOverrideunknown—

Bone2D

A bone of a 2D rig: an entity whose Transform is its joint, reaching a length along its own +x.

Explained in animation/rig-2d.

FieldTypeDefaultNotes
lengthnumber0How far the bone reaches along its +x. An IK chain ending here reaches for the target with this end. Range ≥ 0.

BoneConstraint2D

Limits a bone's rotation, or makes it copy another entity's rotation or position, or look at it.

Explained in animation/rig-2d.

FieldTypeDefaultNotes
kindenumLimit Rotation One of Limit Rotation, Copy Rotation, Copy Position, Look At.
sourceEntitynoneThe entity copied or looked at. Limit Rotation reads none.
minnumber-45
maxnumber45
offsetnumber0
weightnumber1 Range 0–1, step 0.01.
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

GripHolder

Holds an object in its GripProfile's grip: the arms bent to its anchors, the fingers posed, in one order that cannot loop.

Explained in animation/grip-pose.

FieldTypeDefaultNotes
heldEntitynoneWhat is held: an entity with a GripProfile.
mainHandenumRightThe hand that leads. One of Right, Left.
placementenumHandHand: the object rides the leading hand as the clip moves it. Object: the game places it (aiming) and the leading arm is brought to it. One of Hand, Object.
weightnumber1How much of the hold applies over the clip. Range 0–1, step 0.01.
supportWeightnumber1How much of the supporting hand's hold applies, under the weight. Range 0–1, step 0.01.
blendSecondsnumber0.2About how long taking hold, letting go, or changing what is held takes. Range ≥ 0, step 0.01.
rightHandstringemptyThe right hand joint, by path from this entity. Empty finds it by name.
leftHandstringemptyThe left hand joint, by path from this entity. Empty finds it by name.

GripPose

Holds a rig's hands in a named pose, a pistol grip, a handle, a cup, that fits any rig with fingers.

Explained in animation/grip-pose.

FieldTypeDefaultNotes
rightPosestringemptyopen, relaxed, fist, pistol, support, handle, pinch, cup, or one the game registers. Empty leaves the hand alone.
leftPosestringemptyopen, relaxed, fist, pistol, support, handle, pinch, cup, or one the game registers. Empty leaves the hand alone.
rightWeightnumber1How much of the pose applies, over what a clip is doing with the fingers. Range 0–1, step 0.01.
leftWeightnumber1How much of the pose applies, over what a clip is doing with the fingers. Range 0–1, step 0.01.
rightTriggernumber0How far the index finger has gone from resting to pressing, in a pose that has both. Range 0–1, step 0.01.
leftTriggernumber0How far the index finger has gone from resting to pressing, in a pose that has both. Range 0–1, step 0.01.
blendSecondsnumber0.15About how long a change of pose takes. Range ≥ 0, step 0.01.
rightHandstringemptyThe hand joint, by path from this entity. Empty looks for it by name.
leftHandstringemptyThe hand joint, by path from this entity. Empty looks for it by name.

GripProfile

Where on an object each palm sits, and how its fingers are held there.

Explained in animation/grip-pose.

FieldTypeDefaultNotes
mainAnchorEntitynoneWhere the leading palm sits: an entity under this one. Its +Z is the way the fingers point, +Y the way the palm faces.
supportAnchorEntitynoneWhere the supporting palm sits. Empty holds this in one hand.
mainPosestring"handle"The leading hand's fingers: a captured finger pose, or a grip pose (pistol, handle, support, ...).
supportPosestring"support"The supporting hand's fingers.
mainFingersstringemptyThe leading hand's fingers joint by joint, as JSON. Written by the grip editor; over mainPose where set.
supportFingersstringemptyThe supporting hand's fingers joint by joint, as JSON.
handenumRightThe hand the anchors were placed for. Held with the other leading, they are mirrored. One of Right, Left.
mirrorenumYZ (X)The object's own plane that mirrors the anchors to the other hand. One of YZ (X), XZ (Y), XY (Z).
wrapbooleantrueClose the fingers onto the GripSurface shapes on this object and under it, each stopping where it meets one. The pose says how far they may close.

GripSurface

A cylinder, capsule, sphere or box on a held object that its holder's fingers close onto and stop at.

Explained in animation/grip-pose.

FieldTypeDefaultNotes
shapeenumCylinderWhat the fingers close onto. One of Cylinder, Capsule, Sphere, Box.
directionenumYThe axis a cylinder or capsule runs along. One of X, Y, Z.
centerVec3(0, 0, 0)Its middle, in this entity's own units.
radiusnumber0.5A cylinder's, capsule's or sphere's radius. Range ≥ 0, step 0.001.
heightnumber1A cylinder's or capsule's whole length. Range ≥ 0, step 0.001.
sizeVec3(1, 1, 1)A box's size.

IK2D

Bends the last bones of a limb after the animation has played, so the end of this bone reaches a target.

Explained in animation/rig-2d.

FieldTypeDefaultNotes
targetEntitynoneThe entity the end of this bone reaches for.
chainLengthnumber2How many bones bend, counting this one. Two bones solve exactly and keep their bend; more take an iterative solve. Range 1–32, step 1.
bendnumber1Two bones: the way the middle joint bends, 1 counter-clockwise or -1. Range -1–1, step 2.
weightnumber1How far from the animated pose towards the solve. Range 0–1, step 0.01.
matchTargetRotationbooleanfalseAlso turn this bone to the target's rotation.
enabledbooleantrue

ScreenFade

Fades the screen to a colour over everything, keyed by a timeline or set by a script.

Explained in animation/timeline.

FieldTypeDefaultNotes
amountnumber0How far the screen is faded: 0 clear, 1 the colour. Key it on a timeline to fade. Range 0–1, step 0.01.
colorColor#000000The colour the screen fades to.

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

SpringBone

Makes every bone below this root a spring: the chain trails the animated pose by inertia, falls with gravity and is pulled back toward it (hair, tails, cords).

Explained in animation/spring-bones.

FieldTypeDefaultNotes
enabledbooleantrueOff leaves the chain exactly as the animation poses it.
stiffnessnumber0.1How hard each bone is pulled back toward its animated pose. 0 hangs free, 1 follows the animation exactly. Range 0–1, step 0.01.
dragnumber0.5How much of its speed a bone loses each frame. Higher settles sooner. Range 0–1, step 0.01.
gravityVec3(0, -980, 0)Gravity on the chain, in world units a second squared (world y is up).
windVec3(0, 0, 0)A steady wind on the chain, in world units a second squared. Zero is still air.
windGustnumber0How far gusts swing the wind's strength. 0 is a steady wind, 1 takes it from calm to twice its strength. Range 0–1, step 0.01.
windFrequencynumber0.5Gusts a second. Range ≥ 0, step 0.05.
endLengthnumber0Length of the tip past each end bone, in world units. 0 leaves the end bones unsimulated. Range ≥ 0, step 0.1.
radiusnumber0Thickness of the strand, in world units, kept clear of the colliders. Range ≥ 0, step 0.1.
weightnumber1How much of the simulation is used. 0 is the animation alone. Range 0–1, step 0.01.
collidersEntityEntities with a SpringBoneCollider that this chain is kept out of (the head, the shoulders).

SpringBoneCollider

A sphere or capsule that the spring-bone chains naming it are kept out of.

Explained in animation/spring-bones.

FieldTypeDefaultNotes
shapeenumSphereSphere, or a capsule along the entity's own Y axis. One of Sphere, Capsule.
radiusnumber10Radius in world units, before the entity's scale. Range ≥ 0, step 0.1.
heightnumber20A capsule's length between the centres of its end spheres, in world units before scale. Range ≥ 0, step 0.1.
offsetVec3(0, 0, 0)Where the centre of the shape is, in the entity's own space.

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

TimeDilation

Slows or speeds the game, multiplying its own time scale: a timeline’s slow-motion beat.

Explained in animation/timeline.

FieldTypeDefaultNotes
scalenumber1How fast the game runs while this is on: 0.25 is slow motion. Key it on a timeline for a slow-motion beat. Range 0–4, step 0.05.

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
wrapModestringemptyOverride the clip's own wrap mode: once, loop or pingPong. Empty uses what the clip declares.
finishedbooleanfalseClip completed (runtime, read-only). Raise Playing to replay.
bindingNamesarrayempty
bindingsEntityWhat each of the timeline’s bound tracks (a path starting @Name) animates on this player.
rangeStartnumber0Where this player starts in the timeline. Range ≥ 0, step 0.05.
rangeEndnumber0Where it ends, or loops back from; 0 is the timeline’s end. Range ≥ 0, step 0.05.
unscaledTimebooleanfalseRun on real time, on while the game is paused (Time.scale 0).