Skip to content

Commit

Permalink
Fix timers.rs documentation (#9290)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
arsmilitaris authored Jul 30, 2023
1 parent 335109f commit 370eed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/ecs/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fn setup(mut commands: Commands) {
)));
}

/// This system ticks all the `Timer` components on entities within the scene
/// using bevy's `Time` resource to get the delta between each update.
/// This system ticks the `Timer` on the entity with the `PrintOnCompletionTimer`
/// 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>) {
for mut timer in &mut query {
if timer.tick(time.delta()).just_finished() {
Expand Down

0 comments on commit 370eed0

Please sign in to comment.