add music

This commit is contained in:
2025-03-01 00:52:32 +01:00
parent 24765342ba
commit a7864e3ca0
2 changed files with 5 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ fn main() {
app.add_plugins(TrenchBroomPlugin(TrenchBroomConfig::new("hedz")));
app.add_systems(Startup, write_trenchbroom_config);
app.add_systems(Startup, (write_trenchbroom_config, music));
app.add_systems(PostStartup, setup_scene);
app.add_systems(
Update,
@@ -135,6 +135,10 @@ fn spawn_box(
}
}
fn music(asset_server: Res<AssetServer>, mut commands: Commands) {
commands.spawn(AudioPlayer::new(asset_server.load("sfx/music/02.ogg")));
}
fn write_trenchbroom_config(server: Res<TrenchBroomServer>) {
server.config.write_folder("trenchbroom/hedz").unwrap()
}