use super::*; pub use avian2d::prelude::*; /// 2D Physics systems, resources, events, etc. pub struct Physics2dPlugin; impl Plugin for Physics2dPlugin { fn build(&self, app: &mut App) { app.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin::default())) .add_systems( Update, toggle_physics_debug_render.run_if(state_changed::), ); } } fn toggle_physics_debug_render( state: Res>, mut config_store: ResMut, ) { let (_, config) = config_store.config_mut::(); *config = match state.get() { // TODO: Not all, don't want to hide mesh DebuggingState::On => PhysicsGizmos::default(), DebuggingState::Off => PhysicsGizmos::none(), }; }