debugging!!

This commit is contained in:
Schrottkatze 2025-05-21 15:56:23 +02:00
parent 6d269d0c14
commit f518a2c670
Signed by: schrottkatze
SSH key fingerprint: SHA256:FPOYVeBy3QP20FEM42uWF1Wa/Qhlk+L3S2+Wuau/Auo
4 changed files with 25 additions and 9 deletions

6
.gitignore vendored
View file

@ -1,9 +1,3 @@
/target
/.direnv
# Added by cargo
#
# already existing elements were commented out
#/target

View file

@ -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"

18
src/debugging.rs Normal file
View file

@ -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::<AppState>::new(),
));
}

View file

@ -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::<AppState>()
.add_plugins(game::plugin)
.add_systems(Startup, camera::setup)
.add_plugins(game::plugin)
.init_state::<AppState>()
.register_type::<AppState>()
.add_plugins(debugging::plugin)
.run();
}