diff --git a/crates/bevy_asset/src/assets.rs b/crates/bevy_asset/src/assets.rs index d444cdee2d..d92e535f80 100644 --- a/crates/bevy_asset/src/assets.rs +++ b/crates/bevy_asset/src/assets.rs @@ -133,6 +133,15 @@ impl Assets { self.assets.iter().map(|(k, v)| (*k, v)) } + pub fn iter_mut(&mut self) -> impl Iterator { + for id in self.assets.keys() { + self.events.send(AssetEvent::Modified { + handle: Handle::weak(*id), + }); + } + self.assets.iter_mut().map(|(k, v)| (*k, v)) + } + pub fn ids(&self) -> impl Iterator + '_ { self.assets.keys().cloned() }