Simplify a doc example for EventWriter
(#7549)
# Objective Use the `World::send_event` method added in #5355 to simplify a doc example for `EventWriter`.
This commit is contained in:
parent
5581cfe0d1
commit
5d2cd08165
@ -278,8 +278,7 @@ impl<'w, 's, E: Event> EventReader<'w, 's, E> {
|
|||||||
/// // NOTE: the event won't actually be sent until commands get flushed
|
/// // NOTE: the event won't actually be sent until commands get flushed
|
||||||
/// // at the end of the current stage.
|
/// // at the end of the current stage.
|
||||||
/// commands.add(|w: &mut World| {
|
/// commands.add(|w: &mut World| {
|
||||||
/// let mut events_resource = w.resource_mut::<Events<_>>();
|
/// w.send_event(MyEvent);
|
||||||
/// events_resource.send(MyEvent);
|
|
||||||
/// });
|
/// });
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user