-
-
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
Emit event when scene is ready #9115
Comments
Hey, I want to get into contributing to Bevy and I think this would be a good place for me to start, so if I can try working on this that would be awesome! |
Should this component be applied for both types of spawning? (non-dynamic and dynamic) Or just one of them? @Shatur |
Yes, I think so. |
Could we make this an event instead of a component? Seems more appropriate than a persistent component that forces more archetype fragmentation. |
This is what I outlined in "alternatives". But I think "valid scene" is a persistent state. And you will be able to iterate over all valid scenes + easier to get components of such scene via query. |
it's possible to invalidate a scene by changing the handle, so it would make handling an additional component needs to be kept in sync with that. I would much prefer an event as a one time thing |
Yes, I thought that we will keep the component in sync... But I see your point, let's go with event then. |
On second thought, how we will check if scene was "just loaded" to emit the event? With component approach we can use |
I have an idea, we can emit the event when we insert the scene handle to spawned map. |
Opened #9313. |
# Objective Closes bevyengine#9115, replaces bevyengine#9117. ## Solution Emit event when scene is ready. --- ## Changelog ### Added - `SceneInstanceReady` event when scene becomes ready.
What problem does this solve or what need does it fill?
Scenes spawned with delay and in order to check if scene is spawned we use SceneSpawner::instance_is_ready. But it's not very convenient because you can't actually react on spawning.
What solution would you like?
Introduce
ReadyScene
component that inserted after scene spawning.What alternative(s) have you considered?
Events, but marker component is more flexible because we also be able to filter loaded scenes in queries.
The text was updated successfully, but these errors were encountered: