mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Example for bevy_ecs::event::Events uses deprecated function get_reader (#15216)
Fixes https://github.com/bevyengine/bevy/issues/15214
This commit is contained in:
parent
abac8c7b0f
commit
21e39360f7
1 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ use std::ops::{Deref, DerefMut};
|
|||
///
|
||||
/// // setup
|
||||
/// let mut events = Events::<MyEvent>::default();
|
||||
/// let mut reader = events.get_reader();
|
||||
/// let mut cursor = events.get_cursor();
|
||||
///
|
||||
/// // run this once per update/frame
|
||||
/// events.update();
|
||||
|
@ -54,12 +54,12 @@ use std::ops::{Deref, DerefMut};
|
|||
/// events.send(MyEvent { value: 1 });
|
||||
///
|
||||
/// // somewhere else: read the events
|
||||
/// for event in reader.read(&events) {
|
||||
/// for event in cursor.read(&events) {
|
||||
/// assert_eq!(event.value, 1)
|
||||
/// }
|
||||
///
|
||||
/// // events are only processed once per reader
|
||||
/// assert_eq!(reader.read(&events).count(), 0);
|
||||
/// assert_eq!(cursor.read(&events).count(), 0);
|
||||
/// ```
|
||||
///
|
||||
/// # Details
|
||||
|
|
Loading…
Reference in a new issue