space2
This commit is contained in:
BIN
assets/meshes/library/space2.glb
Normal file
BIN
assets/meshes/library/space2.glb
Normal file
Binary file not shown.
BIN
assets/space1.blend
Normal file
BIN
assets/space1.blend
Normal file
Binary file not shown.
BIN
assets/space2.blend
Normal file
BIN
assets/space2.blend
Normal file
Binary file not shown.
@@ -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>>,
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user