mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-12-21 12:46:01 +00:00
Update to Bevy 0.7.
This commit is contained in:
parent
763e1c361f
commit
7fc4f09c87
|
@ -10,9 +10,8 @@ edition = "2021"
|
|||
[dependencies]
|
||||
alto = "3"
|
||||
anyhow = "1"
|
||||
bevy = { version = "0.6", default-features = false }
|
||||
bevy = { version = "0.7", default-features = false }
|
||||
claxon = "0.4"
|
||||
derive_more = "0.99"
|
||||
hound = "3"
|
||||
lewton = "0.10"
|
||||
minimp3 = "0.5"
|
|
@ -35,7 +35,10 @@ fn load_and_create(
|
|||
.get_group_load_state(handles.sounds.iter().map(|handle| handle.id))
|
||||
== LoadState::Loaded;
|
||||
if handles.loaded {
|
||||
commands.spawn().insert(Listener).insert(Transform::default);
|
||||
commands
|
||||
.spawn()
|
||||
.insert(Listener)
|
||||
.insert(Transform::default());
|
||||
let handle = handles.sounds[0].clone();
|
||||
let buffer = asset_server.get_handle(handle);
|
||||
commands
|
||||
|
@ -46,18 +49,18 @@ fn load_and_create(
|
|||
state: SoundState::Playing,
|
||||
gain: 0.4,
|
||||
looping: true,
|
||||
..Default::default()
|
||||
..default()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
App::build()
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_system(bevy::input::system::exit_on_esc_system.system())
|
||||
.add_system(bevy::input::system::exit_on_esc_system)
|
||||
.add_plugin(OpenAlPlugin)
|
||||
.init_resource::<AssetHandles>()
|
||||
.add_startup_system(setup.system())
|
||||
.add_system(load_and_create.system())
|
||||
.add_startup_system(setup)
|
||||
.add_system(load_and_create)
|
||||
.run();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ use bevy::{
|
|||
transform::TransformSystem,
|
||||
utils::BoxedFuture,
|
||||
};
|
||||
use derive_more::{Deref, DerefMut};
|
||||
use lewton::inside_ogg::OggStreamReader;
|
||||
use minimp3::{Decoder, Error};
|
||||
|
||||
|
@ -206,8 +205,8 @@ pub struct Sound {
|
|||
impl Default for Sound {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
buffer: Default::default(),
|
||||
state: Default::default(),
|
||||
buffer: default(),
|
||||
state: default(),
|
||||
gain: 1.,
|
||||
looping: false,
|
||||
pitch: 1.,
|
||||
|
|
Loading…
Reference in New Issue
Block a user