Closed shmelrad closed 1 year ago
Something like this is already hardcoded for a bunch of common component combinations: https://github.com/jakobhellermann/bevy-inspector-egui/blob/36d7b23922c1298f7280a8ceeac88088bcca45b9/src/world_inspector/mod.rs#L617
The problem is that it not really possible to tell which component should be representative for the entity. For a simple heuristic like component_size == 0
a bunch of entities will be named e.g. RayCastMesh
which isn't really helpful.
I'm gonna close this. We guess based on some heuristics, and if people want to suggest other heuristics they can open a new issue.
I know that it is possible to add a
Name
component to an entity. But I had an idea: if an entity has one component marker, then in the inspector, instead of the Entity, insert the name of this component. Most likely, it is impossible to do this in Rust (Rast is not a dynamic programming language), and if possible, I think it will be quite slow (most likely you will have to iterate through all the components of each entity), but I am not so experienced to confidently state this. But suddenly it's possible :)