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

pub mod components;
mod systems;

use crate::SimulationState;

use self::systems::{interact_with_resume_button, spawn_pause};

pub struct PausePlugin;

impl Plugin for PausePlugin {
    fn build(&self, app: &mut App) {
        app.add_systems(OnEnter(SimulationState::Paused), spawn_pause)
            .add_systems(
                Update,
                interact_with_resume_button.run_if(in_state(SimulationState::Paused)),
            );
    }
}