#Bevy events with macros
10 messages · Page 1 of 1 (latest)
the structure's pretty weird, the vendored egui seems unnecessary, it's not even a library crate
couldn't even find the entrypoint for a bit
it feels like most of this could be done easily with generics
and some of these names are really bad for collisions
also, your EventReader run_ifs will run spuriously, since you don't clear them (each EventReader systemparam has its own cursor)
Ah yeah nah it's not a library, I am just learning bevy and rust and using them to build a software for myself and I just thought I'd share smthg I was doing for handling events and see if it's complete shit or actually not as bad for bevy. I wanted to go the generics route but wanted to try doing it with macros just for fun cause I never had a use case yet for them while writing rust. I just made the repo cz my code is private but wanted to share this specific bit with a simple example. Also bevy egui was just a leftover of me taking this bit of code out of my project, I updated it to work with 0.17-dev to test out the next release with my project. Ill probably delete this in a few days, just wanted some opinions and thoughts as I learn.
Yep I had one system originally that just takes the event reader and updates a resource, that also runs a lot but also makes the resource always have is_changed return true cz it's accessed every frame, so I thought adding the add_if would would stop that since it won't run until there's smthg to read
If there's a better way lemme know!
just clear the event reader in the run_if