2025-05-14 23:14:41 +02:00
|
|
|
use bevy::prelude::*;
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
AppState,
|
|
|
|
cleanup::{self, despawn},
|
|
|
|
};
|
|
|
|
|
|
|
|
mod camera;
|
|
|
|
mod scene;
|
|
|
|
|
|
|
|
/// Gameplay system set. All functions in this control the gameplay (duh).
|
|
|
|
#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)]
|
|
|
|
struct GameplaySet;
|
|
|
|
|
|
|
|
pub fn plugin(app: &mut App) {
|
2025-05-21 15:56:58 +02:00
|
|
|
app.add_systems(OnEnter(AppState::Ingame), scene::setup.in_set(GameplaySet))
|
2025-05-14 23:14:41 +02:00
|
|
|
.add_systems(
|
|
|
|
OnExit(AppState::Ingame),
|
|
|
|
despawn::<cleanup::Scene>.in_set(GameplaySet),
|
2025-05-21 15:56:58 +02:00
|
|
|
)
|
2025-06-18 17:13:52 +02:00
|
|
|
.add_plugins(camera::plugin);
|
2025-05-14 23:14:41 +02:00
|
|
|
app.configure_sets(Update, GameplaySet.run_if(in_state(AppState::Ingame)));
|
|
|
|
}
|