bevy_event_set
A macro to create event bundles for Bevy
Standard practice in Bevy currently is declaring events as an enum. This is fine for many use cases, but in some situations you want to be able to listen for individual events in your systems while still being able to easily send multiple types of events (e.g. when parsing user input).
With the event_set
macro, you can create an event set that allows you to send
multiple event types.
Setup
A bug in a subcrate of Bevy 0.4 prevents this crate from working properly. Add the following patch to your Cargo.toml to apply the fix:
[]
= { = "https://github.com/woubuc/bevy", = "fix/ecs-macro-systemparam-0.4" }
This bug is fixed in Bevy with PR #1434.
Usage
use *;
use *;
// Define your events
;
;
;
// Create an event set named `MyEvents`
event_set!;
// Use the event set in a system
// Subscribe to events selectively in different systems