#How can I get a list of all the component types?

4 messages · Page 1 of 1 (latest)

agile kestrel
#

Hi! I need a way to list all the components in my game. I don't mean for a specific entity, I mean all the possible component types.
Thanks!

eager grove
#

i already answered in #general but i'll put this here for completeness sake:
you can use World::components which returns a Components struct over which you can iterate.
https://docs.rs/bevy/latest/bevy/ecs/prelude/struct.World.html#method.components

https://docs.rs/bevy/latest/bevy/ecs/component/struct.Components.html#method.iter

agile kestrel
#

Thank you!!