Moving more into SystemsRx
Summary
Some of these changes actually happened in previous releases but a few things have been moved down into SystemsRx
such as the pooling mechanisms, as they are useful regardless of the ECS aspect of things, so now they can be used without.
Also there have been some changes thanks to @Fijo which makes it easier to include IObservableGroup
objects on the fly in your systems via attributes by using the GroupBinding
plugin.
GroupBinding Plugin
This is optional but if you do want to include multiple IObservableGroup
objects within your systems (such as IManualSystem
) you can do so like this:
[FromComponents(typeof (LevelComponent))] public IObservableGroup LevelAccessor;
[FromComponents(typeof(EnemyComponent))] public IObservableGroup EnemyAccessor;
Which is directly lifted from the Roguelike2d Repository which has some real life usages of this plugin and how it can simplify the system and reduce dev time/boilerplate, there are some other approaches where you can use FromGroup
to pass in an explicit group or just use FromGroup
without a group on systems which implement IGroupedSystem
, and it will take the default group property as its argument.
This also simplifies those usecases for people who were originally using
IManualSystems
before they got moved toSystemsRx
and were left without a simple way to resolve anIObservableGroup
when needed.