Spy-Shifty / BrokenBricksECS

Rebuild of Unity3D upcoming Entity Component System !OUT OF DEVELOPMENT!
MIT License
162 stars 28 forks source link

StandardSystemRoot does not fully support inheritance - should it be accepted as a feature? #26

Open clayrone opened 6 years ago

clayrone commented 6 years ago

StandardSystemRoot does not look for "OnStart", "OnUpdate" and "OnFixedUpdate" in base types of the componentSystem parameter of the AddSystem method, which makes abstraction a bit uncomfortable.

Now having said that, I am not exactly sure if this is the actual goal. On one hand, the idea is to make whole thing run faster and, among other things, reduce the polymorphism. On the other hand, not allowing certain level of abstraction may lead to producing lots of code duplicates.

What I would need to do in my current project is to create an abstract system class that extends ComponentSystem, and has some default behavior OnStart and OnFixedUpdate. Right now it will not work unless I edit the StandardSystemRoot (which I would rather not do) or use the system as a visitor in an external class.

My question would be, are you planning to implement this functionality? I realize the Unity ESC is pretty much around the corner (not sure when exactly it arrives), but until then I have found your version a very good ground for experimentation. Thank you for that one!