跳转到内容

EditorBridge

此内容尚不支持你的语言。

Defined in: context.ts:20

Surface the engine exposes to an attached editor host.

registerComponent is called eagerly during defineComponent so the editor knows the full component catalogue. The on* callbacks are all optional — an editor that only needs the catalogue (no live inspector) can leave them unset and avoid any per-mutation overhead.

All entity values are the engine’s numeric Entity handle. Component identification is by the string name that was passed to registerComponent / defineComponent.

optional onComponentAdded(entity, component): void

Defined in: context.ts:30

Fired when a component is first attached to an entity.

number

string

void


optional onComponentChanged(entity, component): void

Defined in: context.ts:36

Fired when component data changes (insert with new data, set, or edit).

number

string

void


optional onComponentRemoved(entity, component): void

Defined in: context.ts:33

Fired when a component is detached from an entity.

number

string

void


optional onEntityDespawned(entity): void

Defined in: context.ts:27

Fired just before an entity is destroyed. Components are still attached.

number

void


optional onEntitySpawned(entity, name?): void

Defined in: context.ts:24

Fired after an entity is created (optionally with a Name component).

number

string

void


optional onParentChanged(child, parent): void

Defined in: context.ts:39

Fired when a parent link changes. parent === null means the entity was unparented.

number

number | null

void


registerComponent(name, defaults, isTag): void

Defined in: context.ts:21

string

Record<string, unknown>

boolean

void