This commit is contained in:
AmadeusWM
2025-04-05 19:52:46 +02:00
parent ec5c4b6205
commit a46f4849c6
6 changed files with 29 additions and 13 deletions

View File

@@ -3,17 +3,15 @@ use bevy::prelude::*;
use crate::{asset_loading::GltfAssets, GameState};
pub fn map_plugin(app: &mut App) {
// app.add_systems(OnEnter(GameState::Playing), spawn_level);
app.add_systems(OnEnter(GameState::Playing), spawn_level);
}
fn spawn_level(
mut commands: Commands,
models: Res<Assets<Gltf>>,
gltf_assets: Res<GltfAssets>) {
gltf_assets: Res<GltfAssets>
) {
let gltf = models.get(&gltf_assets.wall).unwrap();
// commands.spawn(SceneBundle {
// scene: gltf.scenes[0].clone(),
// ..default()
// });
commands.spawn(SceneRoot(gltf.scenes[0].clone()));
}