1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use bevy::prelude::*;

pub mod components;
pub mod events;
mod systems;
use crate::AppState;

use self::{
    events::StartLoad,
    systems::{interact_with_play_button, spawn_main_menu},
};

pub struct MainMenuPlugin;

impl Plugin for MainMenuPlugin {
    fn build(&self, app: &mut App) {
        app.add_event::<StartLoad>()
            .add_systems(OnEnter(AppState::MainMenu), spawn_main_menu)
            .add_systems(Update, interact_with_play_button);
    }
}