Respond to asset changes using observers. #16041
Labels
A-Assets
Load files from disk to use for things like images, models, and sounds
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
It would be quite ergonomic to be able to respond to when assets get loaded, changed, etc, using observers. We currently have
AssetEvent
, but the way currently things stand in Bevy, old-style events (usingEventReader
/EventWriter
) and observer triggers are actually different workflows that are incompatible with one another, even though they both (confusingly) use the same trait (Event
).What solution would you like?
Bevy to "trigger" observer-style events when assets get loaded/changed/etc.
What alternative(s) have you considered?
Just using
EventReader<AssetEvent>
Additional context
If Bevy ever moves to "Assets as Entities" (as was attempted during the AssetsV2 rework, but ultimately dropped in favor of using
Assets<T>
resources as before), this would become even more ergonomic, as the observer trigger could "target" the entity that represents the affected asset.The text was updated successfully, but these errors were encountered: