bevy/crates/bevy_scene/src
Dmytro Banin bf53cf30c7
Align Scene::write_to_world_with to match DynamicScene::write_to_world_with (#13855)
# Objective

Fixes a regression in [previously merged but then reverted
pr](https://github.com/bevyengine/bevy/pull/13714) 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
```rust
scene.write_to_world_with(world, &registry)
```
After
```rust
let mut entity_map = EntityHashMap::default();
scene.write_to_world_with(world, &mut entity_map, &registry)
```
2024-07-15 14:04:09 +00:00
..
bundle.rs Implement clone for most bundles. (#12993) 2024-04-16 16:37:09 +00:00
dynamic_scene_builder.rs
dynamic_scene.rs Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00
lib.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
scene_filter.rs
scene_loader.rs Optimize common usages of AssetReader (#14082) 2024-07-01 19:59:42 +00:00
scene_spawner.rs Align Scene::write_to_world_with to match DynamicScene::write_to_world_with (#13855) 2024-07-15 14:04:09 +00:00
scene.rs Align Scene::write_to_world_with to match DynamicScene::write_to_world_with (#13855) 2024-07-15 14:04:09 +00:00
serde.rs Fix TypeRegistry use in dynamic scene (#12715) 2024-03-28 03:09:31 +00:00