jeffcampbellmakesgames / Entitas-Redux

An entity-component framework for Unity with code generation and visual debugging
MIT License
102 stars 13 forks source link

[BUG] DebugSystemsBehaviour shows wrong values for Update Systems if also reactive systems are present #33

Open TheHacky opened 3 years ago

TheHacky commented 3 years ago

Describe the bug When debugging the runtime of systems in inspector with DebugSystemsBehaviour. It shows the wrong values for the update systems.

Unity Version: Unity 2019.4.12f

To Reproduce

  1. create a new feature
  2. add an IReactiveSystem
  3. add an IUpdateSystem
  4. inspector show values of IUpdateSystem for IReactiveSystem

Expected behavior The values should be of the right systems.

Additional context The problem is that both system types will be added to _updateSystemInfos, but only IUpdateSystems will be added to _updateSystems. So there is an inconsistency between both lists. So why should it be handy to add IReactiveSystem to _updateSystemInfos?

If you want, I can create a PullRequest.

jeffcampbellmakesgames commented 3 years ago

If you want, I can create a PullRequest.

Hi @TheHacky, if you'd like to fork the repo and create a test scene demonstrating this bug that will certainly make it easier for me to be able to respond to this issue! Thanks for asking.

TheHacky commented 3 years ago

Sorry for the late reply. I forked your repo and created a new branch (https://github.com/TheHacky/Entitas-Redux/tree/bug/visual_debug_bug). I added a new folder "Visual Debug Bug" in the "ExampleContent/Scenes". You will find two systems. One UpdateSystem and one ReactiveSystem. The UpdateSystem will sleep for 100ms each frame, but in visual debugging the duration will be shown for the ReactiveSystem.

As I already said it is an inconsistency between _updateSystems and _updateSystemInfos in DebugSystem.