mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-06-09 17:57:39 +00:00
debugging!!
This commit is contained in:
parent
6d269d0c14
commit
f518a2c670
4 changed files with 25 additions and 9 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,9 +1,3 @@
|
||||||
/target
|
/target
|
||||||
/.direnv
|
/.direnv
|
||||||
|
|
||||||
|
|
||||||
# Added by cargo
|
|
||||||
#
|
|
||||||
# already existing elements were commented out
|
|
||||||
|
|
||||||
#/target
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = "0.16.0"
|
bevy = "0.16.0"
|
||||||
|
bevy-inspector-egui = "0.31.0"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
log = "0.4.27"
|
log = "0.4.27"
|
||||||
|
|
||||||
|
|
18
src/debugging.rs
Normal file
18
src/debugging.rs
Normal 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(),
|
||||||
|
));
|
||||||
|
}
|
|
@ -2,9 +2,10 @@ use bevy::prelude::*;
|
||||||
|
|
||||||
mod camera;
|
mod camera;
|
||||||
mod cleanup;
|
mod cleanup;
|
||||||
|
mod debugging;
|
||||||
mod game;
|
mod game;
|
||||||
|
|
||||||
#[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash, Reflect)]
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
enum AppState {
|
enum AppState {
|
||||||
Menus,
|
Menus,
|
||||||
|
@ -16,8 +17,10 @@ enum AppState {
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
.init_state::<AppState>()
|
|
||||||
.add_plugins(game::plugin)
|
|
||||||
.add_systems(Startup, camera::setup)
|
.add_systems(Startup, camera::setup)
|
||||||
|
.add_plugins(game::plugin)
|
||||||
|
.init_state::<AppState>()
|
||||||
|
.register_type::<AppState>()
|
||||||
|
.add_plugins(debugging::plugin)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue