-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move utilities from examples to bevy_state
and add concept of state-scoped entities
#13649
Conversation
bevy_state
bevy_state
and add concept of state-bound entities
Co-authored-by: Alice Cecile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Alice's comments, and otherwise am happy with this!
I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scoped entities should work without bevy_hierarchy
, by despawning entities not recursively, and the doc for enable_state_scoped_entities
should mention that behaviour
as it is currently, it should at least mentions that it despawns recursively
Co-authored-by: François Mockers <[email protected]>
Co-authored-by: François Mockers <[email protected]>
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1347 if you'd like to help out. |
Objective
Move
StateScoped
andlog_transitions
tobevy_state
, since they're useful for end users.Addresses #12852, although not in the way the issue had in mind.
Solution
bevy_hierarchy
to default features ofbevy_state
.log_transitions
totransitions
module.StateScoped
tostate_scoped
module, gated behindbevy_hierarchy
feature.enable_state_coped_entities<S: States>()
to add required machinery toApp
for clearing state-scoped entities.Changelog
log_transitions
for displaying state transitions.StateScoped
for binding entity lifetime to state and appenable_state_coped_entities
to register cleaning behavior.