mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
Fix timers.rs documentation (#9290)
# Objective The documentation for the `print_when_completed` system stated that this system would tick the `Timer` component on every entity in the scene. This was incorrect as this system only ticks the `Timer` on entities with the `PrintOnCompletionTimer` component. ## Solution We suggest a modification to the documentation of this system to make it more clear.
This commit is contained in:
parent
335109f724
commit
370eed05e5
1 changed files with 2 additions and 2 deletions
|
@ -43,8 +43,8 @@ fn setup(mut commands: Commands) {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This system ticks all the `Timer` components on entities within the scene
|
/// This system ticks the `Timer` on the entity with the `PrintOnCompletionTimer`
|
||||||
/// using bevy's `Time` resource to get the delta between each update.
|
/// component using bevy's `Time` resource to get the delta between each update.
|
||||||
fn print_when_completed(time: Res<Time>, mut query: Query<&mut PrintOnCompletionTimer>) {
|
fn print_when_completed(time: Res<Time>, mut query: Query<&mut PrintOnCompletionTimer>) {
|
||||||
for mut timer in &mut query {
|
for mut timer in &mut query {
|
||||||
if timer.tick(time.delta()).just_finished() {
|
if timer.tick(time.delta()).just_finished() {
|
||||||
|
|
Loading…
Reference in a new issue