mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-07-02 01:27:39 +00:00
34 lines
846 B
Rust
34 lines
846 B
Rust
use bevy::prelude::*;
|
|
|
|
use crate::{
|
|
AppState,
|
|
cleanup::{self, despawn},
|
|
};
|
|
|
|
mod camera;
|
|
mod debug;
|
|
mod scene;
|
|
mod tram {
|
|
use bevy::prelude::*;
|
|
|
|
fn spawn_tram(
|
|
mut c: Commands,
|
|
mut meshes: ResMut<Assets<Mesh>>,
|
|
mut materials: ResMut<Assets<StandardMaterial>>,
|
|
) {
|
|
}
|
|
}
|
|
|
|
/// 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) {
|
|
app.add_systems(OnEnter(AppState::Ingame), scene::setup.in_set(GameplaySet))
|
|
.add_systems(
|
|
OnExit(AppState::Ingame),
|
|
despawn::<cleanup::Scene>.in_set(GameplaySet),
|
|
)
|
|
.add_plugins((debug::plugin, camera::plugin));
|
|
app.configure_sets(Update, GameplaySet.run_if(in_state(AppState::Ingame)));
|
|
}
|