From 623b53c34f8a070dd32445a1d6135acf2a7fc7bd Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 26 Sep 2024 12:25:40 +0300 Subject: [PATCH] feat(dev): add bevy inspector egui --- Cargo.toml | 4 ++-- src/dev_tools.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2cb5457..a8d8225 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,8 @@ tracing = { version = "0.1", features = [ ] } hexx = { version = "0.18", features = ["bevy_reflect", "grid"] } bevy_prototype_lyon = "0.12" +bevy-inspector-egui = { version = "0.26", optional = true } -[dev-dependencies] -bevy-inspector-egui = "0.26" [features] default = [ @@ -32,6 +31,7 @@ dev = [ # Improve compile times for dev builds by linking Bevy as a dynamic library. "bevy/dynamic_linking", "bevy/bevy_dev_tools", + "bevy-inspector-egui", ] dev_native = [ "dev", diff --git a/src/dev_tools.rs b/src/dev_tools.rs index 7f387db..1b78f7e 100644 --- a/src/dev_tools.rs +++ b/src/dev_tools.rs @@ -9,6 +9,8 @@ use bevy::{ prelude::*, }; +use bevy_inspector_egui::quick::WorldInspectorPlugin; + use crate::screens::Screen; pub(super) fn plugin(app: &mut App) { @@ -17,6 +19,7 @@ pub(super) fn plugin(app: &mut App) { // Toggle the debug overlay for UI. app.add_plugins(DebugUiPlugin); + app.add_plugins(WorldInspectorPlugin::default()); app.add_systems( Update, toggle_debug_ui.run_if(input_just_pressed(TOGGLE_KEY)),