Class: ActiveSystem
Top-down DFS: activeInHierarchy = parent.activeInHierarchy && self.active. Other systems gate on this so disabling an entity hides its whole subtree. The same walk derives underCanvas (has a Canvas on itself or an ancestor) for the 2D-renders-only-in-a-Canvas rule.
Skips the walk when nothing changed since last frame — checked via the dirty flag on each ActiveComponent (set by the auto-dirty setter when .active flips) plus a subscription to ActiveComponent adds. With a 50k-entity tree whose active never flips, the steady-state cost drops from a recursive DFS to a single linear scan of dirty bits.
Extends
Constructors
Constructor
ts
new ActiveSystem(): ActiveSystem;Returns
ActiveSystem
Inherited from
Properties
| Property | Modifier | Type | Default value | Inherited from |
|---|---|---|---|---|
enabled | public | boolean | true | System.enabled |
parallel | public | boolean | false | System.parallel |
Methods
GetName()
ts
GetName(): string;Returns
string
Overrides
GetOrder()
ts
GetOrder(): SystemOrder;Returns
SystemOrder
GetPhase()
ts
GetPhase(): SystemPhase;Returns
Overrides
OnClose()
ts
OnClose(): void;Returns
void
Inherited from
OnInit()
ts
OnInit(_engine): void;Parameters
| Parameter | Type |
|---|---|
_engine | IEngine |
Returns
void
Inherited from
OnRender()
ts
OnRender(scene, _renderer): void;Parameters
| Parameter | Type |
|---|---|
scene | Scene |
_renderer | IRenderer |
Returns
void
Overrides
OnRendererChanged()
ts
OnRendererChanged(_renderer): void;Parameters
| Parameter | Type |
|---|---|
_renderer | IRenderer |
Returns
void
Inherited from
OnStart()
ts
OnStart(scene, _renderer): void;Parameters
| Parameter | Type |
|---|---|
scene | Scene |
_renderer | IRenderer |
Returns
void
Overrides
OnStop()
ts
OnStop(_scene): void;Parameters
| Parameter | Type |
|---|---|
_scene | Scene |
Returns
void
Overrides
OnUpdate()
ts
OnUpdate(_scene, _dt): void | Promise<void>;Parameters
| Parameter | Type |
|---|---|
_scene | Scene |
_dt | number |
Returns
void | Promise<void>
Inherited from
Refresh()
ts
Refresh(scene): void;The walk, when something changed. Also run before the update phases (ActiveUpdateSystem), so update systems gating on activeInHierarchy see this tick's state — a freshly loaded scene's inactive entities included.
Parameters
| Parameter | Type |
|---|---|
scene | Scene |
Returns
void