state modifs

This commit is contained in:
2026-09-18 22:39:29 +02:00
parent 26448cd0a0
commit 8d496eee73
8 changed files with 64 additions and 98 deletions
+15 -7
View File
@@ -1,6 +1,6 @@
use bevy::prelude::*;
use crate::{camera::MainCamera, player::Player};
use crate::{camera::MainCamera, game_state::GameState, player::Player};
#[derive(Component)]
pub struct DebugCamera;
@@ -103,11 +103,19 @@ pub struct DebugPlugin;
impl Plugin for DebugPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, spawn_debug_camera)
.add_systems(Startup, setup_debug_camera.after(spawn_debug_camera))
.add_systems(Startup, spawn_debug_frame)
.add_systems(Update, draw_view_frame)
.add_systems(Update, follow_player_debug)
.add_systems(Update, toggle_debug_camera);
app.add_systems(
Startup,
(
spawn_debug_camera,
setup_debug_camera.after(spawn_debug_camera),
spawn_debug_frame,
)
.run_if(in_state(GameState::InGame)),
)
.add_systems(
Update,
(draw_view_frame, follow_player_debug, toggle_debug_camera)
.run_if(in_state(GameState::InGame)),
);
}
}