Align `Scene::write_to_world_with` to match `DynamicScene::write_to_world_with`
Objective
Fixes a regression in previously merged but then reverted pr that aligns lower-level Scene API with that in DynamicScene. Please look at the original pr for more details.
The problem was spawn_sync_internal is used in spawn_queued_scenes. Since instance creation was moved up a level we need to make sure we add a specific instance to SceneSpawner::spawned_instances when using spawn_sync_internal (just like we do for DynamicScene).
Please look at the last commit when reviewing.
Testing
alien_cake_addict and deferred_rendering examples look as expected.
Changelog
Changed Scene::write_to_world_with to take entity_map as an argument and no longer return an InstanceInfo
Migration Guide
Scene::write_to_world_with no longer returns an InstanceInfo.
Before
scene.write_to_world_with(world, ®istry)
After
let mut entity_map = EntityHashMap::default();
scene.write_to_world_with(world, &mut entity_map, ®istry)
@alice-i-cecile Anything I can do on my end to move this pr along?
Can you swap this to a more descriptive title and then post about this in #scenes-dev please?
@NthTensor You approved the last version - do you have a chance to take a look at this updated one?
~~@dmyyy I'd also recommend updating your PR description as parts of it are from #13714 and don't really have to do with this fix~~
Never mind, I didn't realize that PR was reverted and this is re-applying those commits.
~@dmyyy I'd also recommend updating your PR description as parts of it are from #13714 and don't really have to do with this fix~
Never mind, I didn't realize that PR was reverted and this is re-applying those commits.
The description is a little bit confusing - I updated the wording a little
I've double-checked the examples and no regressions this time :)