chore: Upgrade to Bevy 0.15.
All checks were successful
Test / test (ubuntu-latest) (push) Successful in 1m57s

This commit is contained in:
Nolan Darilek 2024-12-06 09:33:24 -06:00
parent fe5816b722
commit 3c557fa5ab
4 changed files with 12 additions and 21 deletions

View File

@ -10,12 +10,12 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { version = "0.14", default-features = false, features = ["bevy_asset"] }
bevy = { version = "0.15", default-features = false, features = ["bevy_asset"] }
synthizer = "0.5.6"
thiserror = "1"
[dev-dependencies]
bevy = { version = "0.14", default-features = true }
bevy = { version = "0.15", default-features = true }
[package.metadata.release]
publish = false

View File

@ -31,14 +31,10 @@ fn load_and_create(
if !listeners.is_empty() {
return;
}
commands.spawn((
TransformBundle::default(),
Listener,
RotationTimer::default(),
));
commands.spawn((Transform::default(), Listener, RotationTimer::default()));
let handle = asset_server.load("footstep.wav");
commands.spawn((
TransformBundle::from(Transform::from_translation(Vec3::new(10., 0., 0.))),
Transform::from_translation(Vec3::new(10., 0., 0.)),
Source::default(),
Sound {
audio: handle.into(),

View File

@ -13,16 +13,12 @@ impl Default for RotationTimer {
}
fn setup(mut commands: Commands, context: Res<Context>) {
commands.spawn((
TransformBundle::default(),
Listener,
RotationTimer::default(),
));
commands.spawn((Transform::default(), Listener, RotationTimer::default()));
let generator: syz::Generator = syz::FastSineBankGenerator::new_sine(&context, 440.)
.expect("Failed to create generator")
.into();
commands.spawn((
TransformBundle::from(Transform::from_translation(Vec3::new(10., 0., 0.))),
Transform::from_translation(Vec3::new(10., 0., 0.)),
Source::default(),
Sound {
audio: generator.into(),

View File

@ -2,9 +2,8 @@
use std::collections::HashMap;
use bevy::{
asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext},
asset::{io::Reader, AssetLoader, LoadContext},
prelude::*,
reflect::TypePath,
transform::TransformSystem,
};
pub use synthizer as syz;
@ -30,11 +29,11 @@ impl AssetLoader for BufferAssetLoader {
type Settings = ();
type Error = BufferAssetLoaderError;
async fn load<'a>(
&'a self,
reader: &'a mut Reader<'_>,
_settings: &'a (),
_load_context: &'a mut LoadContext<'_>,
async fn load(
&self,
reader: &mut dyn Reader,
_settings: &(),
_load_context: &mut LoadContext<'_>,
) -> Result<Self::Asset, Self::Error> {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;