add debug log

This commit is contained in:
2025-04-02 19:30:06 +02:00
parent e247f72b78
commit b3138e211f
6 changed files with 112 additions and 18 deletions

12
src/debug.rs Normal file
View File

@@ -0,0 +1,12 @@
use bevy::prelude::*;
use bevy_debug_log::LogViewerVisibility;
pub fn plugin(app: &mut App) {
app.add_systems(Update, update);
}
fn update(mut commands: Commands, keyboard: Res<ButtonInput<KeyCode>>) {
if keyboard.just_pressed(KeyCode::Backquote) {
commands.trigger(LogViewerVisibility::Toggle);
}
}