From 14307a710bb4df2075a386328d415028bebf6ff0 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Sat, 7 Oct 2023 21:57:36 -0700 Subject: [PATCH] Very simple audio --- Cargo.toml | 2 +- src/audio.rs | 38 +++++++++++++++++++++++++++++++++++++- src/display2d.rs | 4 ++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8ded452..0b3201e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" build = "build.rs" [dependencies] -bevy_fmod = "0.3" +bevy_fmod = { version = "0.3", features = ["live-update"] } bevy = "0.11" diff --git a/src/audio.rs b/src/audio.rs index f77cccf..d71387b 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -1,3 +1,6 @@ +/// +/// TODO: Custom Asset: FmodEventMapper +/// use crate::prelude::*; pub(crate) struct AudioPlugin; @@ -11,6 +14,39 @@ impl Plugin for AudioPlugin { "./assets/audio/Martian Chess/Build/Desktop/Music.bank", "./assets/audio/Martian Chess/Build/Desktop/SFX.bank", ], - }); + }) + .add_systems(OnExit(GameState::Loading), play_background) + .add_systems( + Update, + ( + play_audio.run_if(any_with_component::