Crates.io | bevy-add-events-macro |
lib.rs | bevy-add-events-macro |
version | 0.1.0 |
source | src |
created_at | 2022-07-30 04:27:14.848414 |
updated_at | 2022-07-30 04:27:14.848414 |
description | A macro to add multiple events to a bevy app easily |
homepage | |
repository | https://git.tebibyte.media/nexus |
max_upload_size | |
id | 635332 |
size | 2,134 |
This is a macro to add events. Given these events:
struct Event1;
struct Event2;
struct Event3;
struct Event4;
struct Event5;
This is the code you have to normally write in bevy
pub fn main() {
let mut app = App::new();
app.add_event::<Event1>();
app.add_event::<Event2>();
app.add_event::<Event3>();
app.add_event::<Event4>();
app.add_event::<Event5>();
}
And this is the code you can write with the add_events! macro!
pub fn main() {
let mut app = App::new();
add_events!(app, Event1, Event2, Event3, Event4, Event5);
}