Update to Bevy 0.7.

This commit is contained in:
Nolan Darilek 2022-05-03 09:22:32 -05:00
parent 763e1c361f
commit 7fc4f09c87
3 changed files with 12 additions and 11 deletions

View File

@ -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"

View File

@ -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();
}

View File

@ -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.,