Don't use ScenePatchInstance for queued scenes#24474
Conversation
laundmo
left a comment
There was a problem hiding this comment.
Simple fix. at the cost of a resource access, but i think thats inevitable here and probably costs less than the archetype move of the insert.
|
Wait, is It seems like
|
Yeah this is fine.
Functionally, all "queued scenes" are "waiting for the scene to load". |
|
@laundmo sadly |
| ); | ||
|
|
||
| loop { | ||
| core::mem::swap(&mut *world.resource_mut::<QueuedScenes>(), &mut queued); |
There was a problem hiding this comment.
I moved this loop until after the "asset load event" processing to ensure that we spawn queued scenes that are produced from the spawning of those scene asset loads now rather than waiting a frame.
I've also moved the mem::swap into the loop to ensure we check for newly queued spawns after spawning the current queue.
Objective
Fix #24320
Solution
Don't use
ScenePatchInstancefor queued scenes. Instead, use QueuedScenes directly.Testing
The example in #24320 now works.