Change detection through asset handles? #11631
Answered
by
mockersf
torsteingrindvik
asked this question in
Q&A
-
Today I tried something along the lines of q: Query<(&mut Transform, &Handle<MyAsset>), Changed<Handle<MyAsset>> hoping that hot-reloading updates on the asset would trigger the change detection filter. It didn't work. Is this expected since the asset is behind a handle? Is there an idiomatic way of doing this? |
Beta Was this translation helpful? Give feedback.
Answered by
mockersf
Jan 31, 2024
Replies: 1 comment 1 reply
-
Your filter would match if the handle itself changed on this entity, not if the assets pointed to by the handle changed. When an asset changed, you'll get an event |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
torsteingrindvik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your filter would match if the handle itself changed on this entity, not if the assets pointed to by the handle changed.
When an asset changed, you'll get an event
AssetEvent
, up to you to keep a map handle <-> Vec