-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add SceneInstanceReady
#9313
Merged
alice-i-cecile
merged 2 commits into
bevyengine:main
from
projectharmonia:instance-ready-event
Aug 15, 2023
Merged
Add SceneInstanceReady
#9313
alice-i-cecile
merged 2 commits into
bevyengine:main
from
projectharmonia:instance-ready-event
Aug 15, 2023
Conversation
This file contains 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
Shatur
force-pushed
the
instance-ready-event
branch
from
July 31, 2023 08:33
682971d
to
302ffbf
Compare
alice-i-cecile
added
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
A-Scenes
Serialized ECS data stored on the disk
labels
Jul 31, 2023
alice-i-cecile
requested changes
Jul 31, 2023
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 like this solution better: one quick improvement though :)
Shatur
force-pushed
the
instance-ready-event
branch
from
July 31, 2023 18:10
87f6053
to
2432b59
Compare
alice-i-cecile
approved these changes
Jul 31, 2023
hymm
approved these changes
Aug 10, 2023
alice-i-cecile
added
the
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
label
Aug 11, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Aug 14, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Aug 14, 2023
Shatur
added a commit
to projectharmonia/bevy
that referenced
this pull request
Aug 19, 2023
# Objective Closes bevyengine#9115, replaces bevyengine#9117. ## Solution Emit event when scene is ready. --- ## Changelog ### Added - `SceneInstanceReady` event when scene becomes ready.
43 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jul 30, 2024
# Objective The `SceneInstanceReady` event would be more ergonomic (and potentially efficient) if it could be delivered to listeners attached to the scene entities becoming ready rather than into a World-global queue. This is an evolution of @Shatur's work in #9313. ## Solution The scene spawner is changed to trigger observers on the scene entity when it is ready rather than enqueue an event with `EventWriter`. This addresses the two outstanding feature requests mentioned on #2218, that i) the events should be "scoped" in some way and ii) that the `InstanceId` should be included in the event. ## Testing Modified the `scene_spawner::tests::event` test to use the new mechanism. --- ## Changelog - Changed `SceneInstanceReady` to trigger an entity observer rather than be written to an event queue. - Changed `SceneInstanceReady` to carry the `InstanceId` of the scene. ## Migration Guide If you have a system which read `SceneInstanceReady` events: > ```fn ready_system(ready_events: EventReader<'_, '_, SceneInstanceReady>) {``` It must be rewritten as an observer: > ```commands.observe(|trigger: Trigger<SceneInstanceReady>| {``` Or, if you were expecting the event in relation to a specific entity or entities, as an entity observer: > ```commands.entity(entity).observe(|trigger: Trigger<SceneInstanceReady>| {```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Scenes
Serialized ECS data stored on the disk
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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
Closes #9115, replaces #9117.
Solution
Emit event when scene is ready.
Changelog
Added
SceneInstanceReady
event when scene becomes ready.