bevy_basic_ui/pause/mod.rs
1use bevy::prelude::*;
2
3pub mod components;
4mod systems;
5
6use crate::SimulationState;
7
8use self::systems::{interact_with_resume_button, spawn_pause};
9
10pub struct PausePlugin;
11
12impl Plugin for PausePlugin {
13 fn build(&self, app: &mut App) {
14 app.add_systems(OnEnter(SimulationState::Paused), spawn_pause)
15 .add_systems(
16 Update,
17 interact_with_resume_button.run_if(in_state(SimulationState::Paused)),
18 );
19 }
20}