2025-05-14 23:14:41 +02:00
|
|
|
use bevy::prelude::*;
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
AppState,
|
|
|
|
cleanup::{self, despawn},
|
|
|
|
};
|
|
|
|
|
|
|
|
mod camera;
|
2025-06-17 20:50:46 +02:00
|
|
|
mod debug;
|
2025-05-14 23:14:41 +02:00
|
|
|
mod scene;
|
2025-06-10 20:11:08 +02:00
|
|
|
mod tram {
|
|
|
|
use bevy::prelude::*;
|
|
|
|
|
|
|
|
fn spawn_tram(
|
|
|
|
mut c: Commands,
|
|
|
|
mut meshes: ResMut<Assets<Mesh>>,
|
|
|
|
mut materials: ResMut<Assets<StandardMaterial>>,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
}
|
2025-05-14 23:14:41 +02:00
|
|
|
|
|
|
|
/// 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-17 20:50:46 +02:00
|
|
|
.add_plugins((debug::plugin, camera::plugin));
|
2025-05-14 23:14:41 +02:00
|
|
|
app.configure_sets(Update, GameplaySet.run_if(in_state(AppState::Ingame)));
|
|
|
|
}
|