Description
What problem does this solve or what need does it fill?
Having a list of all resources or all components is useful for debugging purposes.
This will be particularly valuable in the editor.
What solution would you like?
~~Add a Resources
system parameter.
On both the Components
and Resources
system parameter, implement Iter
, returning ComponentInfo
as the item.~~
EDIT: this has been fixed for resources by #12829, but an equivalent for components is still missing.
What alternative(s) have you considered?
Right now, you can use the complex method listed in https://bevy-cheatbook.github.io/cookbook/print-resources.html for resources, but no such obvious method exists for components.
Blindly check component IDs from Components
by trying all of the usize
options (or hoping they're strictly contiguous and start at 0).
World::inspect_entity
can be used to inspect all of the components of a specific entity, and was added in #5136.
Additional context
#15435 improves this situation for query errors and could be helpful inspiration.