#Ability to add systems to a world based on its attributes

1 messages · Page 1 of 1 (latest)

slate kiln
#

Hello. As the project grows, you are forced to use DisableAutoCreation attribute.

But, adding systems to system groups manually is tedious. Especially when systems already provide enough info in their attributes.

For example

    [UpdateInGroup(typeof(InitializationSystemGroup), OrderLast = true)]
    [DisableAutoCreation]
    public partial class PlayerMovementSystem : SystemBase 

All you have right now is AddSystemToUpdateList. You cannot specify UpdateAfter or UpdateBefore.

I suggest that World::CreateSystem would accept a bool paramater addToUpdateList and automatically add itself to a proper group with a correct ordering.

unborn radish
#

can't say I've used DisableAutoCreation in about 3 years, why do you need it?

#

are you looking for [WorldSystemFilter]

#
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation | WorldSystemFilterFlags.LocalSimulation)]
or
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]```
kind of thing
#

also supports default system placement when placed on system groups

[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ServerSimulation, 
                   WorldSystemFilterFlags.ServerSimulation)]```
slate kiln
unborn radish
#

oh this is the one reason i use disableautocreation except you can put it on an entire assembly

#

[assembly: DisableAutoCreation]

#

so you don't need to put it per system

#

great for unit testing assemblies

slate kiln
#

Yep. Though I need to create them manually

#

I do it through script, though adding them into update loops is tedious

#

Plus you can't sort them

unborn radish
#

seems like it'd just be easier to put them in a system group and just conditionally add that group to the world or not?

#

side note, you can just call Sort on a system group after you add a system to it to sort

#

wait hang on

#

AddSystemToUpdateList

#

does that already

slate kiln
#

I'll test it really quick