state modifs
This commit is contained in:
+15
-7
@@ -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)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user