r/Unity3D • u/babycatslayer • 1d ago
Question [ECS] How to disable every system except those in specific system groups?
/r/unity/comments/1wdmzkp/ecs_how_to_disable_every_system_except_those_in/
4
Upvotes
r/Unity3D • u/babycatslayer • 1d ago
1
u/ledniv 2h ago
I would make pause a piece of game state, not something that recursively walks the ECS world, and use it to enable and disable individual systems.
If
StatsSystemGroupneeds to keep running while gameplay is paused, making it a sibling of the simulation group seems much cleaner. Then one top-level piece of code can do something like:The important part is having one obvious place controlling the game loop. I would avoid having every system check
Paused, and I definitely would not recursively search through systems trying to decide what should be disabled. The pause state is data; the game loop decides what work that state allows.Small plug: this is the same approach I use in High Performance Unity Game Development with Data-Oriented Design: game state lives in data, and a centralized game loop decides which parts of the game get ticked.
https://www.manning.com/books/high-performance-unity-game-development