docs: use read instead of deprecated iter (#10376)

https://docs.rs/bevy/latest/bevy/ecs/event/struct.EventReader.html#method.iter

# Objective

- Remove doc example using deprecated `EventReader.iter` method

## Solution

- Update docs to use `read` instead of `iter`
This commit is contained in:
Jesus Bracho 2023-11-04 22:03:42 -04:00 committed by GitHub
parent 1bd1c25b1a
commit 32a5c7db35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,7 @@ use bevy_utils::Duration;
/// struct PauseEvent(bool);
///
/// fn pause_system(mut time: ResMut<Time<Virtual>>, mut events: EventReader<PauseEvent>) {
/// for ev in events.iter() {
/// for ev in events.read() {
/// if ev.0 {
/// time.pause();
/// } else {