-
-
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
Fire events when scenes spawn #2425
Conversation
Ok(_) => {} | ||
Err(SceneSpawnError::NonExistentScene { .. }) => { | ||
self.dynamic_scenes_to_spawn.push(scene_handle) | ||
world.resource_scope( |
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.
Actually spawning scenes requires a mut World
, so I think this is necessary. Open to other approaches.
Co-authored-by: Nathan Ward <43621845+NathanSWard@users.noreply.github.com>
bors try |
tryBuild succeeded: |
You should also send events when scenes are spawned with the sync methods ( |
@mockersf so you'd prefer if the event were written inside the sync methods? Is there a case where the sync methods get called directly? I didn't pursue this initially because we need to get an event writer via Alternatively, the |
That's correct. There should be effectively no ramifications to that though: we already have In exchange, consistency and reliability are improved significantly. I definitely agree with Francois's proposal. |
They are public, so we don't know if anyone is using them directly... They are the only way to spawn a scene without waiting for a frame, so it makes sense to keep them public. |
@mockersf I had another pass at this. It is a little awkward that we event one event in |
Yup dynamic scenes are missing a few things that added complexity to non dynamic scenes... I changed some of that in #2424. Yours or mine will have to be updated whichever gets merged last (probably mine as yours is much simpler) |
bors try |
tryMerge conflict. |
Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Just left some thoughts in #2218. I'd like to discuss UX + api design a bit more before moving forward on this. |
Closing this out for now as I think we need to think about the comments in #2218 before designing this API. We can resurrect if this ends up being the right base for it. |
Objective
Solution
SceneSpawnedEvent
as the new event type. Open to a different name / structure; are there related events that should be considered?spawn_queued_scenes
, fire events when spawning scenes succeedsAlso, this is my first slightly larger code contribution, apologies if my style / approach is off :)