bevy icon indicating copy to clipboard operation
bevy copied to clipboard

add `Resources::iter` to iterate over all resource IDs

Open jakobhellermann opened this issue 3 years ago • 0 comments

Objective

In bevy 0.8 you could list all resources using world.archetypes().resource().components(). As far as I can tell the resource archetype has been replaced with the Resources storage, and it would be nice if it could be used to iterate over all resource component IDs as well.

Solution

  • add fn Resources::iter(&self) -> impl Iterator<Item = (ComponentId, &ResourceData)>

jakobhellermann avatar Nov 13 '22 20:11 jakobhellermann