update gltf example to use type-safe GltfAssetLabel::Scene (#14218)

# Objective

update the `load_gltf_extras.rs` example to the newest bevy api

## Solution

uses the new type-safe code for loading the scene #0 from the gltf
instead of a path suffix

## Testing

the example runs as expected
This commit is contained in:
Johannes Vollmer 2024-07-14 17:42:32 +02:00 committed by GitHub
parent d008227553
commit 57d05927d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,9 +29,11 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
},
..default()
});
// a barebones scene containing one of each gltf_extra type
commands.spawn(SceneBundle {
scene: asset_server.load("models/extras/gltf_extras.glb#Scene0"),
scene: asset_server
.load(GltfAssetLabel::Scene(0).from_asset("models/extras/gltf_extras.glb")),
..default()
});