EntityWorld.AddSystem Method
Definition
Namespace: Brine2D.ECS
| Overloads | |
|---|---|
| AddSystem<T>\(Action<T>\) | Adds a system to this world, automatically creating it with dependency injection. Systems that implement IUpdateSystem are added to the update pipeline. Systems that implement IFixedUpdateSystem are added to the fixed update pipeline. Systems that implement IRenderSystem are added to the render pipeline. Systems can implement multiple interfaces. |
| AddSystem<T>\(T\) | Adds a pre-constructed system instance to this world, bypassing dependency injection. |
EntityWorld.AddSystem\<T>\(Action\<T\>\) Method
Adds a system to this world, automatically creating it with dependency injection. Systems that implement IUpdateSystem are added to the update pipeline. Systems that implement IFixedUpdateSystem are added to the fixed update pipeline. Systems that implement IRenderSystem are added to the render pipeline. Systems can implement multiple interfaces.
Type parameters
T
The system type to create and add.
Parameters
configure System.Action<T>
Optional configuration action for the system.
Implements AddSystem<T>\(Action<T>\)
Example
C#
World.AddSystem<Box2DPhysicsSystem>();
World.AddSystem<DebugRenderer>(debug =>
{
debug.ShowColliders = true;
debug.IsEnabled = false;
});
// Dependencies are resolved automatically from DI
World.AddSystem<PlayerControllerSystem>();
EntityWorld.AddSystem\<T>\(T\) Method
Adds a pre-constructed system instance to this world, bypassing dependency injection.
Type parameters
T
Parameters
instance T
Implements AddSystem<T>\(T\)