mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
iter_mut()
for Assets type (#3118)
# Objective Fixes #3117 ## Solution I took `get_mut()` and did it for all the elements 😏 Co-authored-by: MiniaczQ <jakub.motyka.2000@gmail.com>
This commit is contained in:
parent
5127274b31
commit
8b30dc6354
1 changed files with 9 additions and 0 deletions
|
@ -133,6 +133,15 @@ impl<T: Asset> Assets<T> {
|
|||
self.assets.iter().map(|(k, v)| (*k, v))
|
||||
}
|
||||
|
||||
pub fn iter_mut(&mut self) -> impl Iterator<Item = (HandleId, &mut T)> {
|
||||
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<Item = HandleId> + '_ {
|
||||
self.assets.keys().cloned()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue