Open
Description
What problem does this solve or what need does it fill?
When working with complex states, especially for menus, it can be nice to fully preserve the data of various entities while hiding them from the world.
The "despawn when entering / exiting states" behavior in #18818 is useful for full cleanup, but that's not always desirable.
What solution would you like?
Now that we have a Disabled
component, we can do better!
Reuse the StateScoped
component name, and cause it to disable and enable entities based on the states.
What alternative(s) have you considered?
This is easy to implement in third-party code, but it's a natural complement and a useful pattern to teach and use internally in first-party tools.
Additional context
Discussed in #18818.