1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use bevy::prelude::*;
use bevy_lunex::{UiClickEvent, UiSystems};

use systems::{build_main_menu, main_menu_button_clicked_system};

pub mod components;
pub mod systems;

pub struct MainMenuPlugin;

impl Plugin for MainMenuPlugin {
    fn build(&self, app: &mut App) {
        app.add_systems(Update, build_main_menu.before(UiSystems::Compute))
            .add_systems(
                Update,
                main_menu_button_clicked_system.run_if(on_event::<UiClickEvent>()),
            );
    }
}