-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple methods to list all components and all resources #3007
Comments
Related to #1130. |
for reference here's how I do it in my library https://github.com/hymm/bevy_mod_debug_console/blob/c9117098711dd81c0fd2b4a0f98ce4a96e05e427/src/ecs.rs#L35-L73 |
I would like to take this up by implementing additional types Edit: I think I can get by with just implementing |
Now that I am starting to understand how resources are implemented, the task at hand is becoming a bit less clear for me. I see that I could distinguish between proper I can currently see these options:
What would you prefer? Can you see any other options? |
Option 3 was chosen after some discussion with @alice-i-cecile and @BoxyUwU on Discord - thanks for the help! |
Update: decoupling components and resources to be stored separately turned out to be too hard to do, so we have now decided to rename |
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
andResources
system parameter, implementIter
, returningComponentInfo
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 theusize
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.
The text was updated successfully, but these errors were encountered: