Edit release note
This commit is contained in:
parent
c697e92439
commit
4754becc28
@ -28,9 +28,9 @@ or an observer event with `EventReader`, leaving the user wondering why the even
|
||||
|
||||
**Bevy 0.17** aims to solve this ambiguity by splitting the event traits into `Event`, `EntityEvent`, and `BufferedEvent`.
|
||||
|
||||
- `Event`: A shared trait for all events.
|
||||
- `EntityEvent`: An `Event` that additionally supports targeting specific entities and propagating the event from one entity to another.
|
||||
- `BufferedEvent`: An `Event` that additionally supports usage with `EventReader` and `EventWriter` for pull-based event handling.
|
||||
- `Event`: A shared trait for observer events.
|
||||
- `EntityEvent`: An observer `Event` that additionally supports targeting specific entities and propagating the event from one entity to another.
|
||||
- `BufferedEvent`: An event that supports usage with `EventReader` and `EventWriter` for pull-based event handling.
|
||||
|
||||
## Using Events
|
||||
|
||||
@ -92,7 +92,7 @@ let armor_piece = commands
|
||||
commands.trigger_targets(Damage { amount: 10.0 }, armor_piece);
|
||||
```
|
||||
|
||||
To allow an event to be used with the buffered API, you can also derive `BufferedEvent`:
|
||||
To allow an event to be used with the buffered API, you can derive `BufferedEvent`:
|
||||
|
||||
```rust
|
||||
#[derive(BufferedEvent)]
|
||||
@ -117,5 +117,5 @@ fn read_messages(mut reader: EventReader<Message>) {
|
||||
In summary:
|
||||
|
||||
- Need a basic event you can trigger and observe? Derive `Event`!
|
||||
- Need the event to be targeted at an entity? Derive `EntityEvent`!
|
||||
- Need the observer event to be targeted at an entity? Derive `EntityEvent`!
|
||||
- Need the event to be buffered and support the `EventReader`/`EventWriter` API? Derive `BufferedEvent`!
|
||||
|
Loading…
Reference in New Issue
Block a user