1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use bevy::prelude::*;
use bevy_lunex::UiSystems;
use components::SplashTimer;
use systems::build_splash;

use crate::UiState;

use self::systems::count_down;

pub mod components;
pub mod systems;

pub struct SplashPlugin;
impl Plugin for SplashPlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource::<SplashTimer>(SplashTimer(Timer::from_seconds(5.0, TimerMode::Once)))
            .add_systems(
                Update,
                (
                    build_splash.before(UiSystems::Compute),
                    count_down.run_if(in_state(UiState::Splash)),
                ),
            );
    }
}