I'm working on a DOTS project where the team has developed a bunch of static utility classes, which provide static methods used to query or manipulate the world entities from the UI, from systems or from MonoBehaviours.
However I don't like the design of these utility classes, since they need a lot of information to be passed as parameter:
- The world (often the default one is statically referenced from the method itself and I don't like it)
- The entityManager
- The commandBuffers (if the method needs to manipulate stuff)
And many overload the same method are created to support parallel buffers or lookups... it is chaos.
I've found a cleaner way but I'm not sure it is the intended way to do this. I found that having these utility methods in Systems (that can be easly retrieved through from anywhere through world.GetExistingSystem) is way cleaner, since I can use SystemAPI. It works very well but now I have a bunch of systems without the OnUpdate method, just staying there. Is this a performance problem? Is it a good idea?