Switch to PluginGroup.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nolan Darilek 2022-12-20 18:49:35 -06:00
parent aa054c3637
commit 4ecacb73ad

View File

@ -1,8 +1,6 @@
use std::{fmt::Debug, hash::Hash}; use std::{fmt::Debug, hash::Hash};
use bevy::prelude::*; use bevy::{app::PluginGroupBuilder, prelude::*};
use crate::core::CoreConfig;
pub mod footstep; pub mod footstep;
pub mod icon; pub mod icon;
@ -22,28 +20,23 @@ pub use volumetric::Volumetric;
} }
}*/ }*/
pub struct SoundPlugin<'a, S>(std::marker::PhantomData<&'a S>); pub struct SoundPlugins<'a, S>(std::marker::PhantomData<&'a S>);
impl<'a, S> Default for SoundPlugin<'a, S> { impl<'a, S> Default for SoundPlugins<'a, S> {
fn default() -> Self { fn default() -> Self {
Self(std::marker::PhantomData) Self(std::marker::PhantomData)
} }
} }
impl<S> Plugin for SoundPlugin<'static, S> impl<S> PluginGroup for SoundPlugins<'static, S>
where where
S: 'static + Clone + Debug + Eq + Hash + Send + Sync, S: 'static + Clone + Debug + Eq + Hash + Send + Sync,
{ {
fn build(&self, app: &mut App) { fn build(self) -> PluginGroupBuilder {
let _core_config = *app.world.get_resource::<CoreConfig>().unwrap(); PluginGroupBuilder::start::<Self>()
/*if let Some(context) = app.world.get_resource::<Context>() { .add(footstep::FootstepPlugin)
context .add(icon::SoundIconPlugin::<S>::default())
.set_meters_per_unit(1. / core_config.pixels_per_unit as f32) .add(volumetric::VolumetricPlugin)
.unwrap();
}*/
app.add_plugin(footstep::FootstepPlugin)
.add_plugin(icon::SoundIconPlugin::<S>::default())
.add_plugin(volumetric::VolumetricPlugin);
// .add_system(scale_sounds); // .add_system(scale_sounds);
} }
} }