Skip to content

System

Defined in: System.ts:11

Base class for systems. Systems run in a specific game loop phase, query for entities matching a component signature, and operate on them.

Systems are primarily for engine plugins (physics, rendering, audio). Game developers typically write Components instead.

new System(): System

System

protected context: EngineContext

Defined in: System.ts:22

Reference to the engine context, set on registration.


enabled: boolean = true

Defined in: System.ts:19

Whether this system is active.


abstract readonly phase: Phase

Defined in: System.ts:13

The phase this system runs in.


readonly priority: number = 0

Defined in: System.ts:16

Execution priority within the phase. Lower = earlier. Default: 0.

_setContext(context): void

Defined in: System.ts:30

Internal

Set the engine context. Called by Engine during startup.

EngineContext

void


optional onRegister(context): void

Defined in: System.ts:46

Called once when the system is registered with the engine.

EngineContext

void


optional onUnregister(): void

Defined in: System.ts:52

Called when the system is removed.

void


abstract update(dt): void

Defined in: System.ts:49

Called every frame (or every fixed step for FixedUpdate).

number

void


protected use<T>(key): T

Defined in: System.ts:35

Resolve a service by key, cached after first lookup.

T

ServiceKey<T>

T