mirror of
https://github.com/bevyengine/bevy
synced 2024-11-30 00:20:20 +00:00
cf3105a0db
# Objective I want to run a system once after a given delay. - First, I tried using the `on_timer` run condition, but it uses a repeating timer, causing the system to run multiple times. - Next, I tried combining the `on_timer` with the `run_once` run condition. However, this causes the timer to *tick* only once, so the system is never executed. ## Solution - ~~Replace `on_timer` by `on_time_interval` and `on_real_timer` by `on_real_time_interval` to clarify the meaning (the old ones are deprecated to avoid a breaking change).~~ (Reverted according to feedback) - Add `once_after_delay` and `once_after_real_delay` to run the system exactly once after the delay, using `TimerMode::Once`. - Add `repeating_after_delay` and `repeating_after_real_delay` to run the system indefinitely after the delay, using `Timer::finished` instead of `Timer::just_finished`. --- ## Changelog ### Added - `once_after_delay` and `once_after_real_delay` run conditions to run the system exactly once after the delay, using `TimerMode::Once`. - `repeating_after_delay` and `repeating_after_real_delay` run conditions to run the system indefinitely after the delay, using `Timer::finished` instead of `Timer::just_finished`. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
Bevy Time
The built-in timekeeping plugin for the Bevy game engine.