-
Notifications
You must be signed in to change notification settings - Fork 0
System
Ehsan Rashidi edited this page Oct 27, 2025
·
1 revision
Systems are responsible for processing entities and reacting to state changes.
They encapsulate logic, control execution order, and optimize updates within the ECS architecture.
The base class for all ECS systems.
-
interactsWith– The set of entity types this system will interact with (trigger events or update components).
-
log(String message, {ECSLogLevel level})(protected) – Log messages via the feature’s manager. -
getEntity<TEntity extends ECSEntity>()(protected) – Retrieve an entity of a specific type, checking cache, feature, and manager in order.
Systems that perform setup tasks before execution.
-
initialize()– Override to implement initialization logic.
- Called once after the first frame and before other systems.
Systems that perform periodic tasks during execution.
-
executesIf– Determines whether the system should execute on each frame.
-
execute(Duration elapsed)– Override to implement recurring logic.
- Called every frame if
executesIfistrue.
Systems that perform cleanup tasks after execution.
-
cleansIf– Determines whether cleanup should be executed on this frame.
-
cleanup()– Override to implement cleanup logic.
- Executed after all
ExecuteSystems and before the next frame.
Systems that perform final teardown tasks.
-
teardown()– Override to implement teardown logic.
- Called once after the last frame and before disposing the application.
Systems that react to entity changes.
-
reactsTo– The set of entity types this system reacts to (event triggers or component updates). -
reactsIf– Whether the system reacts when an entity changes.
-
react()– Override to implement reaction logic.
- Reactive systems are event-driven.
- Optimize by specifying
reactsToto only track relevant entities andreactsIf.