diff --git a/.gitignore b/.gitignore index 0484576..8b0789b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ /target /.direnv - -# Added by cargo -# -# already existing elements were commented out - -#/target diff --git a/Cargo.toml b/Cargo.toml index 6f5dd37..12896db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ edition = "2024" [dependencies] bevy = "0.16.0" +bevy-inspector-egui = "0.31.0" env_logger = "0.11.8" log = "0.4.27" diff --git a/src/debugging.rs b/src/debugging.rs new file mode 100644 index 0000000..5833dbc --- /dev/null +++ b/src/debugging.rs @@ -0,0 +1,18 @@ +//! Seperate out debugging uis/plugins in it's own module for cleanliness. +use bevy::prelude::*; +use bevy_inspector_egui::{ + bevy_egui::EguiPlugin, + quick::{StateInspectorPlugin, WorldInspectorPlugin}, +}; + +use crate::AppState; + +pub fn plugin(app: &mut App) { + app.add_plugins(EguiPlugin { + enable_multipass_for_primary_context: true, + }) + .add_plugins(( + WorldInspectorPlugin::new(), + StateInspectorPlugin::::new(), + )); +} diff --git a/src/main.rs b/src/main.rs index 5638344..7d919c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,9 +2,10 @@ use bevy::prelude::*; mod camera; mod cleanup; +mod debugging; mod game; -#[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash)] +#[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash, Reflect)] #[allow(unused)] enum AppState { Menus, @@ -16,8 +17,10 @@ enum AppState { fn main() { App::new() .add_plugins(DefaultPlugins) - .init_state::() - .add_plugins(game::plugin) .add_systems(Startup, camera::setup) + .add_plugins(game::plugin) + .init_state::() + .register_type::() + .add_plugins(debugging::plugin) .run(); }