Function bevy_time::common_conditions::paused

source ·
pub fn paused(time: Res<'_, Time<Virtual>>) -> bool
Expand description

Run condition that is active when the Time<Virtual> clock is paused. Use bevy_ecs::schedule::common_conditions::not to make it active when it’s not paused.

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(
            Update,
            (
                is_paused.run_if(paused),
                not_paused.run_if(not(paused)),
            )
        )
    .run();
}
fn is_paused() {
    // ran when time is paused
}

fn not_paused() {
    // ran when time is not paused
}