This commit is contained in:
AmadeusWM committed 2025-04-05 22:15:42 +02:00
1 parent eeae924c8d
commit 932fd4c65e
5 files changed
+3 -5

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
-2
View File
@@ -30,8 +30,6 @@ pub(crate) struct AudioAssets {}
#[derive(AssetCollection, Resource, Clone)]
pub(crate) struct GltfAssets {
#[asset(key = "house")]
pub(crate) house: Handle<Gltf>,
#[asset(key = "library", collection(typed, mapped))]
pub(crate) library: HashMap<String, Handle<Gltf>>,
}
+3 -3
View File
@@ -12,10 +12,10 @@ fn spawn_level(
gltf_assets: Res<GltfAssets>
) {
println!("LIBRARY: {:?}", gltf_assets.library);
let jumbo = gltf_assets.library.get("meshes/library/wall.glb").unwrap();
let gltf = models.get(jumbo).unwrap();
let jumbo = gltf_assets.library.get("meshes/library/space2.glb").expect("Couldn't find object in library");
let gltf = models.get(jumbo).expect("No model for space2");
// commands.spawn(SceneRoot(gltf.scenes[0].clone()));
let asset = gltf.default_scene.as_ref().unwrap();
let asset = gltf.default_scene.as_ref().expect("No scene in space2");
commands.spawn(SceneRoot(asset.clone()));
}