mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
eb51b4c28e
# 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), )); ``` |
||
---|---|---|
.. | ||
files | ||
processing | ||
alter_mesh.rs | ||
alter_sprite.rs | ||
asset_decompression.rs | ||
asset_loading.rs | ||
asset_settings.rs | ||
custom_asset.rs | ||
custom_asset_reader.rs | ||
embedded_asset.rs | ||
extra_source.rs | ||
hot_asset_reloading.rs | ||
multi_asset_sync.rs | ||
repeated_texture.rs |