INNER CODE UNIT · Rust
build
CleanCut/rusty_engine · src/audio.rs:72
fn build(&self, app: &mut bevy::prelude::App) {
app.add_systems(Update, queue_managed_audio_system);
}
}
/// You will interact with the [`AudioManager`] for all audio needs in Rusty Engine. It is exposed
/// through the [`Engine`](crate::prelude::Engine) struct provided to your logic function
/// each frame as the [`audio_manager`](crate::prelude::Engine::audio_manager) field. It is also
/// accessible through the [`Game`](crate::prelude::Game) struct in your `main` function.
#[derive(Default)]
pub struct AudioManager {
sfx_queue: Vec<(String, f32)>,
music_queue: Vec<Option<(String, f32)>>,
playing: Option<Entity>,
music_playing: bool,
}
impl Debug for AudioManager {