跳转到内容

CommandsInstance

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

Defined in: ecs/commands.ts:205

The command queue a system declared with Commands. Records structural work — spawn, despawn, add or remove a component, install a resource — and applies it when the system returns, so nothing moves under a running query.

new CommandsInstance(world, resources): CommandsInstance

Defined in: ecs/commands.ts:211

World

ResourceStorage

CommandsInstance

despawn(entity): this

Defined in: ecs/commands.ts:226

number

this


entity(entity): EntityCommands

Defined in: ecs/commands.ts:222

number

EntityCommands


flush(): void

Defined in: ecs/commands.ts:294

void


insertResource<T>(resource, value): this

Defined in: ecs/commands.ts:241

T

ResourceDef<T>

T

this


queueInsert(entity, component, data): void

Defined in: ecs/commands.ts:250

number

AnyComponentDef

unknown

void


queueRemove(entity, component): void

Defined in: ecs/commands.ts:254

number

AnyComponentDef

void


queueSetParent(entity, parent): void

Defined in: ecs/commands.ts:258

number

number

void


resource<T>(def): T | null

Defined in: ecs/commands.ts:237

A world-level service, for the work no component write can express. Null where nothing installed it — an app assembled without that plugin is a fact to report, not a crash. Here rather than on each context because this is the one door every authored surface already holds.

T

ResourceDef<T>

T | null


spawn(name?): EntityCommands

Defined in: ecs/commands.ts:216

string

EntityCommands