The hide flags that determine the hiding behavior of the component.
Zh
确定组件隐藏行为的标志。
set hideFlags(value): void
参数
value: number
返回 void
id
get id(): number
返回 number
En
The unique identifier for the component.
Zh
组件的唯一标识。
isPlaying
get isPlaying(): boolean
返回 boolean
En
If the animation is currently playing.
Zh
动画是否正在播放。
loop
get loop(): number
返回 number
En
Number of loops: -1 use clip's islooping, 0 infinite, 1 once, 2 twice, etc.
Zh
循环次数:-1 使用 clip 的 islooping,0 无限,1 一次,2 两次等。
set loop(v): void
参数
v: number
返回 void
speed
get speed(): number
返回 number
En
The playback speed of the animation.
Zh
播放速度
set speed(num): void
参数
num: number
返回 void
yoyo
get yoyo(): boolean
返回 boolean
En
Whether to play forward then backward (yoyo).
Zh
是否往返播放(先正向后反向)。
set yoyo(v): void
参数
v: boolean
返回 void
方法
destroy
destroy(): void
返回 void
En
Destroy components
Zh
销毁组件
gotoAndStop
gotoAndStop(normalizedTime): void
参数
normalizedTime: number
0~1
返回 void
En
Go to the given normalized time and stop.
Zh
跳转到指定归一化时间并停止。
gotoAndStopByFrame
gotoAndStopByFrame(frame): void
参数
frame: number
Frame index
返回 void
En
Jump to the given frame and stop.
Zh
跳转到指定帧并停止。
hasHideFlag
hasHideFlag(flag): boolean
参数
flag: number
The hide flag to check for.
返回 boolean
En
Checks if the component has a specific hide flag set.
Zh
检查组件是否设置了特定的隐藏标志。
onAdded
onAdded(): void
返回 void
En
Called after the component is added to a node. Unlike Awake, onAdded is called even if the node is not active.
Zh
组件被添加到节点后调用,与 onAwake 不同的是,即使节点未激活也会调用 onAdded。
Blueprint Event
onAwake
onAwake(): void
返回 void
En
Executed after the component is activated. At this point, all nodes and components have been created. This method is executed only once.
Zh
组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次。
Blueprint Event
onDestroy
onDestroy(): void
返回 void
En
Executed when the node is destroyed manually.
Zh
手动调用节点销毁时执行。
Blueprint Event
onDisable
onDisable(): void
返回 void
En
Executed when the component is disabled, such as when the node is removed from the stage.
Zh
组件被禁用时执行,比如从节点从舞台移除后。
Blueprint Event
onEnable
onEnable(): void
返回 void
En
Executed after the component is enabled, such as when the node is added to the stage.
Zh
组件被启用后执行,比如节点被添加到舞台后。
Blueprint Event
可选onLateUpdate
onLateUpdate(): void
返回 void
En
Executed every frame during the late update phase, after the update phase.
Zh
每帧更新时执行,在 late update 阶段,update 阶段之后。
Blueprint Event
可选onPostRender
onPostRender(): void
返回 void
En
Executed after rendering.
Zh
渲染之后执行。
Blueprint Event
可选onPreRender
onPreRender(): void
返回 void
En
Executed before rendering.
Zh
渲染之前执行。
Blueprint Event
可选onReset
onReset(): void
返回 void
En
Resets the component's parameters to their default values. If this function is implemented, the component will be reset and automatically recycled for future use.
If not reset, it will not be recycled for reuse.
En
2D animator component that plays a single AnimationClip2D directly, without a state machine.
Zh
直接播放单个 2D 动画片段的组件,无需状态机。