bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Align `Scene::write_to_world_with` to match `DynamicScene::write_to_world_with`

Open dmyyy opened this issue 8 months ago • 5 comments

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, &registry)

After

let mut entity_map = EntityHashMap::default();
scene.write_to_world_with(world, &mut entity_map, &registry)

dmyyy avatar Jun 15 '24 01:06 dmyyy