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.
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new System():
System
Returns
Section titled “Returns”System
Properties
Section titled “Properties”context
Section titled “context”
protectedcontext:EngineContext
Defined in: System.ts:22
Reference to the engine context, set on registration.
enabled
Section titled “enabled”enabled:
boolean=true
Defined in: System.ts:19
Whether this system is active.
abstractreadonlyphase:Phase
Defined in: System.ts:13
The phase this system runs in.
priority
Section titled “priority”
readonlypriority:number=0
Defined in: System.ts:16
Execution priority within the phase. Lower = earlier. Default: 0.
Methods
Section titled “Methods”_setContext()
Section titled “_setContext()”_setContext(
context):void
Defined in: System.ts:30
Internal
Set the engine context. Called by Engine during startup.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void
onRegister()?
Section titled “onRegister()?”
optionalonRegister(context):void
Defined in: System.ts:46
Called once when the system is registered with the engine.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void
onUnregister()?
Section titled “onUnregister()?”
optionalonUnregister():void
Defined in: System.ts:52
Called when the system is removed.
Returns
Section titled “Returns”void
update()
Section titled “update()”
abstractupdate(dt):void
Defined in: System.ts:49
Called every frame (or every fixed step for FixedUpdate).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
protecteduse<T>(key):T
Defined in: System.ts:35
Resolve a service by key, cached after first lookup.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”ServiceKey<T>
Returns
Section titled “Returns”T