Compare commits

..

2 Commits

Author SHA1 Message Date
3c094e3b89 Rename and make public. 2022-06-02 18:37:08 -05:00
8dad8d41e0 Derive Debug. 2022-06-01 14:45:48 -05:00

View File

@ -10,7 +10,7 @@ use bevy::{
}; };
pub use synthizer as syz; pub use synthizer as syz;
#[derive(Clone, Deref, DerefMut, PartialEq, TypeUuid)] #[derive(Clone, Debug, Deref, DerefMut, PartialEq, TypeUuid)]
#[uuid = "6b6b533a-bb1f-11ec-bda2-00155d8fdde9"] #[uuid = "6b6b533a-bb1f-11ec-bda2-00155d8fdde9"]
pub struct Buffer(syz::Buffer); pub struct Buffer(syz::Buffer);
@ -421,7 +421,7 @@ pub struct SynthizerConfig {
} }
#[derive(Debug)] #[derive(Debug)]
struct Defaults { pub struct SynthizerDefaults {
panner_strategy: syz::PannerStrategy, panner_strategy: syz::PannerStrategy,
distance_model: syz::DistanceModel, distance_model: syz::DistanceModel,
distance_ref: f64, distance_ref: f64,
@ -431,7 +431,7 @@ struct Defaults {
closeness_boost_distance: f64, closeness_boost_distance: f64,
} }
fn sync_config(context: Res<syz::Context>, config: Res<SynthizerConfig>, defaults: Res<Defaults>) { fn sync_config(context: Res<syz::Context>, config: Res<SynthizerConfig>, defaults: Res<SynthizerDefaults>) {
if config.is_changed() { if config.is_changed() {
context context
.default_panner_strategy() .default_panner_strategy()
@ -516,7 +516,7 @@ impl Plugin for SynthizerPlugin {
if !app.world.contains_resource::<SynthizerConfig>() { if !app.world.contains_resource::<SynthizerConfig>() {
app.insert_resource(SynthizerConfig::default()); app.insert_resource(SynthizerConfig::default());
} }
let defaults = Defaults { let defaults = SynthizerDefaults {
panner_strategy: context.default_panner_strategy().get().unwrap(), panner_strategy: context.default_panner_strategy().get().unwrap(),
distance_model: context.default_distance_model().get().unwrap(), distance_model: context.default_distance_model().get().unwrap(),
distance_ref: context.default_distance_ref().get().unwrap(), distance_ref: context.default_distance_ref().get().unwrap(),