bevy/examples/window
Tim eb51b4c28e
Migrate scenes to required components (#15579)
# Objective

A step in the migration to required components: scenes!

## Solution

As per the [selected
proposal](https://hackmd.io/@bevy/required_components/%2FPJtNGVMMQhyM0zIvCJSkbA):
- Deprecate `SceneBundle` and `DynamicSceneBundle`.
- Add `SceneRoot` and `DynamicSceneRoot` components, which wrap a
`Handle<Scene>` and `Handle<DynamicScene>` respectively.

## Migration Guide
Asset handles for scenes and dynamic scenes must now be wrapped in the
`SceneRoot` and `DynamicSceneRoot` components. Raw handles as components
no longer spawn scenes.

Additionally, `SceneBundle` and `DynamicSceneBundle` have been
deprecated. Instead, use the scene components directly.

Previously:
```rust
let model_scene = asset_server.load(GltfAssetLabel::Scene(0).from_asset("model.gltf"));

commands.spawn(SceneBundle {
    scene: model_scene,
    transform: Transform::from_xyz(-4.0, 0.0, -3.0),
    ..default()
});
```
Now:
```rust
let model_scene = asset_server.load(GltfAssetLabel::Scene(0).from_asset("model.gltf"));

commands.spawn((
    SceneRoot(model_scene),
    Transform::from_xyz(-4.0, 0.0, -3.0),
));
```
2024-10-01 22:42:11 +00:00
..
clear_color.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
custom_user_event.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
low_power.rs Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +00:00
monitor_info.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
multiple_windows.rs Migrate scenes to required components (#15579) 2024-10-01 22:42:11 +00:00
scale_factor_override.rs Fixing text sizes for examples (#15190) 2024-09-16 23:14:37 +00:00
screenshot.rs Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +00:00
transparent_window.rs Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
window_resizing.rs Fixing text sizes for examples (#15190) 2024-09-16 23:14:37 +00:00
window_settings.rs Add custom cursors (#14284) 2024-08-12 15:49:03 +00:00