Swap to using EventWriter and EventReader in internal engine code #3397
Labels
C-Code-Quality
A section of code that is hard to understand or change
D-Trivial
Nice and easy! A great choice to get started with Bevy
Many of our internal systems were written before the advent of
EventWriter
andEventReader
, and so work with eitherResMut<Events<T>>
orRes<Events<T>>
.These can (and probably should) generally be swapped to
EventWriter
andEventReader
because:EventReader
andEventWriter
, rather than the raw resource types.You can see an example here:
bevy/crates/bevy_gilrs/src/gilrs_system.rs
Line 19 in e48f9d8
Finding all of these should be easy, just search for
Res<Events
andResMut<Events
in the code base. Fixing them should be similarly straightforward, although please leave a comment in your PR if you found any usages that could not be trivially converted.The text was updated successfully, but these errors were encountered: