This commit is contained in:
AmadeusWM
2025-04-05 22:15:30 +02:00
parent eeae924c8d
commit 932fd4c65e
5 changed files with 3 additions and 5 deletions

Binary file not shown.

BIN
assets/space1.blend Normal file

Binary file not shown.

BIN
assets/space2.blend Normal file

Binary file not shown.

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>>,
}

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()));
}