Function bevy_internal::time::common_conditions::once_after_delay
source · pub fn once_after_delay(duration: Duration) -> impl FnMut(Res<'_, Time>) + Clone
Expand description
Run condition that is active once after the specified delay,
using Time
to advance the timer.
The timer ticks at the rate of Time::relative_speed
.
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(
Update,
tick.run_if(once_after_delay(Duration::from_secs(1))),
)
.run();
}
fn tick() {
// ran once, after a second
}