feat(dev): add bevy inspector egui

This commit is contained in:
Kristofers Solo 2024-09-26 12:25:40 +03:00
parent ec9ac21b8f
commit 623b53c34f
2 changed files with 5 additions and 2 deletions

View File

@ -19,9 +19,8 @@ tracing = { version = "0.1", features = [
] } ] }
hexx = { version = "0.18", features = ["bevy_reflect", "grid"] } hexx = { version = "0.18", features = ["bevy_reflect", "grid"] }
bevy_prototype_lyon = "0.12" bevy_prototype_lyon = "0.12"
bevy-inspector-egui = { version = "0.26", optional = true }
[dev-dependencies]
bevy-inspector-egui = "0.26"
[features] [features]
default = [ default = [
@ -32,6 +31,7 @@ dev = [
# Improve compile times for dev builds by linking Bevy as a dynamic library. # Improve compile times for dev builds by linking Bevy as a dynamic library.
"bevy/dynamic_linking", "bevy/dynamic_linking",
"bevy/bevy_dev_tools", "bevy/bevy_dev_tools",
"bevy-inspector-egui",
] ]
dev_native = [ dev_native = [
"dev", "dev",

View File

@ -9,6 +9,8 @@ use bevy::{
prelude::*, prelude::*,
}; };
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use crate::screens::Screen; use crate::screens::Screen;
pub(super) fn plugin(app: &mut App) { pub(super) fn plugin(app: &mut App) {
@ -17,6 +19,7 @@ pub(super) fn plugin(app: &mut App) {
// Toggle the debug overlay for UI. // Toggle the debug overlay for UI.
app.add_plugins(DebugUiPlugin); app.add_plugins(DebugUiPlugin);
app.add_plugins(WorldInspectorPlugin::default());
app.add_systems( app.add_systems(
Update, Update,
toggle_debug_ui.run_if(input_just_pressed(TOGGLE_KEY)), toggle_debug_ui.run_if(input_just_pressed(TOGGLE_KEY)),