Hide egui-inspector window behind feature flag
The World Inspector widget shouldn't be enabled by default. This hides it behind the "debug_ui" feature flag, along with the bevy_rapier2d debug drawings. The bevy_rapier2d debug plugin is now added when in debug mode, which was not previously the case.
This commit is contained in:
30
src/main.rs
30
src/main.rs
@@ -1,20 +1,28 @@
|
||||
use bevy::{prelude::*, window::WindowResolution};
|
||||
|
||||
use asteroids::{AsteroidPlugin, config::WINDOW_SIZE};
|
||||
|
||||
#[cfg(feature = "debug_ui")]
|
||||
use bevy_inspector_egui::{bevy_egui::EguiPlugin, quick::WorldInspectorPlugin};
|
||||
#[cfg(feature = "debug_ui")]
|
||||
use bevy_rapier2d::render::RapierDebugRenderPlugin;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||
primary_window: Some(Window {
|
||||
canvas: Some("#game-canvas".to_owned()),
|
||||
resolution: WindowResolution::new(WINDOW_SIZE.0, WINDOW_SIZE.1),
|
||||
..default()
|
||||
}),
|
||||
let mut app = App::new();
|
||||
app.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||
primary_window: Some(Window {
|
||||
canvas: Some("#game-canvas".to_owned()),
|
||||
resolution: WindowResolution::new(WINDOW_SIZE.0, WINDOW_SIZE.1),
|
||||
..default()
|
||||
}))
|
||||
.add_plugins(AsteroidPlugin)
|
||||
.add_plugins(EguiPlugin::default())
|
||||
}),
|
||||
..default()
|
||||
}))
|
||||
.add_plugins(AsteroidPlugin);
|
||||
|
||||
#[cfg(feature = "debug_ui")]
|
||||
app.add_plugins(EguiPlugin::default())
|
||||
.add_plugins(WorldInspectorPlugin::new())
|
||||
.run();
|
||||
.add_plugins(RapierDebugRenderPlugin::default());
|
||||
|
||||
app.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user