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)]
|
#[derive(AssetCollection, Resource, Clone)]
|
||||||
pub(crate) struct GltfAssets {
|
pub(crate) struct GltfAssets {
|
||||||
#[asset(key = "house")]
|
|
||||||
pub(crate) house: Handle<Gltf>,
|
|
||||||
#[asset(key = "library", collection(typed, mapped))]
|
#[asset(key = "library", collection(typed, mapped))]
|
||||||
pub(crate) library: HashMap<String, Handle<Gltf>>,
|
pub(crate) library: HashMap<String, Handle<Gltf>>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ fn spawn_level(
|
|||||||
gltf_assets: Res<GltfAssets>
|
gltf_assets: Res<GltfAssets>
|
||||||
) {
|
) {
|
||||||
println!("LIBRARY: {:?}", gltf_assets.library);
|
println!("LIBRARY: {:?}", gltf_assets.library);
|
||||||
let jumbo = gltf_assets.library.get("meshes/library/wall.glb").unwrap();
|
let jumbo = gltf_assets.library.get("meshes/library/space2.glb").expect("Couldn't find object in library");
|
||||||
let gltf = models.get(jumbo).unwrap();
|
let gltf = models.get(jumbo).expect("No model for space2");
|
||||||
|
|
||||||
// commands.spawn(SceneRoot(gltf.scenes[0].clone()));
|
// 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()));
|
commands.spawn(SceneRoot(asset.clone()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user