enable_state_scoped_entities() as a derive attribute#16180
Merged
mockersf merged 4 commits intobevyengine:mainfrom Dec 1, 2024
Merged
enable_state_scoped_entities() as a derive attribute#16180mockersf merged 4 commits intobevyengine:mainfrom
mockersf merged 4 commits intobevyengine:mainfrom
Conversation
3a5fba2 to
fcd778b
Compare
MrGVSV
reviewed
Oct 30, 2024
aecsocket
approved these changes
Nov 1, 2024
aecsocket
reviewed
Nov 1, 2024
BenjaminBrienen
approved these changes
Nov 1, 2024
andriyDev
approved these changes
Nov 2, 2024
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Dec 2, 2024
# Objective - I got tired of calling `enable_state_scoped_entities`, and though it would make more sense to define that at the place where the state is defined ## Solution - add a derive attribute `#[states(scoped_entities)]` when derive `States` or `SubStates` that enables it automatically when adding the state ## Testing - Ran the examples using it, they still work
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective - I got tired of calling `enable_state_scoped_entities`, and though it would make more sense to define that at the place where the state is defined ## Solution - add a derive attribute `#[states(scoped_entities)]` when derive `States` or `SubStates` that enables it automatically when adding the state ## Testing - Ran the examples using it, they still work
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 8, 2025
# Objective - Reverts #16180 - Fixes #20866 ## Solution - Just enable state scoped entities all the time. No need to keep API surface for disabling that tiiiiiny bit of overhead. If someone needs this, we can still trivially add it back. ## Testing - `bevy run --example state_scope` --------- Co-authored-by: Alice Cecile <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
enable_state_scoped_entities, and though it would make more sense to define that at the place where the state is definedSolution
#[states(scoped_entities)]when deriveStatesorSubStatesthat enables it automatically when adding the stateTesting