Skip to content

API 参考 / ScriptBehavior

Interface: ScriptBehavior ​

Defined in: packages/natsume/src/runtime/runtime.ts:108

Extends ​

Properties ​

onAnimationEvent? ​

optional onAnimationEvent?: AnimationEventHandler

Defined in: packages/natsume/src/runtime/runtime.ts:118

Receives source messages from the Animator on this node; return true when handled.

Methods ​

beforeUpdate()? ​

optional beforeUpdate(deltaSeconds): void

Defined in: packages/natsume/src/runtime/runtime.ts:91

Before animation and simulation; receives the requested frame delta.

Parameters ​

deltaSeconds ​

number

Returns ​

void

Inherited from ​

EffectBehavior.beforeUpdate


destroy()? ​

optional destroy(): void

Defined in: packages/natsume/src/runtime/runtime.ts:96

Returns ​

void

Inherited from ​

EffectBehavior.destroy


lateUpdate()? ​

optional lateUpdate(deltaSeconds): void

Defined in: packages/natsume/src/runtime/runtime.ts:95

After update and field notifications, before rendering; receives the requested frame delta.

Parameters ​

deltaSeconds ​

number

Returns ​

void

Inherited from ​

EffectBehavior.lateUpdate


onAnimatedField()? ​

optional onAnimatedField(name, value): void

Defined in: packages/natsume/src/runtime/runtime.ts:110

Receives the final changed field value after an effect operation, before drawing.

Parameters ​

name ​

string

value ​

ScriptFieldValue

Returns ​

void


onControlTime()? ​

optional onControlTime(seconds): void

Defined in: packages/natsume/src/runtime/runtime.ts:113

Parameters ​

seconds ​

number

Returns ​

void


onControlTimeStart()? ​

optional onControlTimeStart(): void

Defined in: packages/natsume/src/runtime/runtime.ts:112

Timeline ITimeControl lifecycle; callbacks receive clip-local seconds.

Returns ​

void


onControlTimeStop()? ​

optional onControlTimeStop(): void

Defined in: packages/natsume/src/runtime/runtime.ts:114

Returns ​

void


onDisable()? ​

optional onDisable(): void

Defined in: packages/natsume/src/runtime/runtime.ts:89

Returns ​

void

Inherited from ​

EffectBehavior.onDisable


onEnable()? ​

optional onEnable(): void

Defined in: packages/natsume/src/runtime/runtime.ts:88

Returns ​

void

Inherited from ​

EffectBehavior.onEnable


onParticleSystemStopped()? ​

optional onParticleSystemStopped(event): void

Defined in: packages/natsume/src/runtime/runtime.ts:116

Receives StopAction.Callback from a particle system on this node.

Parameters ​

event ​

ParticleSystemStoppedEvent

Returns ​

void


update()? ​

optional update(deltaSeconds): void

Defined in: packages/natsume/src/runtime/runtime.ts:93

After simulation; receives the time actually advanced.

Parameters ​

deltaSeconds ​

number

Returns ​

void

Inherited from ​

EffectBehavior.update

基于 Apache License 2.0 发布