jakobhellermann / bevy-inspector-egui

Inspector plugin for the bevy game engine
Apache License 2.0
1.12k stars 166 forks source link

How to inspect `Entity`? #112

Closed kornelski closed 1 year ago

kornelski commented 1 year ago

In my components I sometimes have fields of Vec<Entity>. I hoped WorldInspectorPlugin would let me recursively see these entities' components, but it only shows their raw IDs, like "123v0".

Is there an option to show the entities in a more meaningful way?

jakobhellermann commented 1 year ago

I just released 0.16.5 which lets you choose how to display the entities:

#[derive(Reflect, InspectorOptions)]
#[reflect(InspectorOptions)]
struct Component {
  #[inspector(display = EntityDisplay::Id)]
  entities_show_id: Vec<Entity>,
  #[inspector(display = EntityDisplay::Components)]
  entities_show_id: Vec<Entity>,
}

but I made Components the default so you don't need to specify the InspectorOptions.