mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 19:43:07 +00:00
26 lines
600 B
Rust
26 lines
600 B
Rust
mod audio_output;
|
|
mod audio_source;
|
|
|
|
pub use audio_output::*;
|
|
pub use audio_source::*;
|
|
|
|
pub mod prelude {
|
|
pub use crate::{AudioOutput, AudioSource};
|
|
}
|
|
|
|
|
|
use bevy_app::prelude::*;
|
|
use bevy_asset::AddAsset;
|
|
use bevy_ecs::IntoQuerySystem;
|
|
|
|
#[derive(Default)]
|
|
pub struct AudioPlugin;
|
|
|
|
impl AppPlugin for AudioPlugin {
|
|
fn build(&self, app: &mut AppBuilder) {
|
|
app.init_resource::<AudioOutput>()
|
|
.add_asset::<AudioSource>()
|
|
.add_asset_loader::<AudioSource, Mp3Loader>()
|
|
.add_system_to_stage(stage::POST_UPDATE, play_queued_audio_system.system());
|
|
}
|
|
}
|