jakobhellermann / bevy-inspector-egui

Inspector plugin for the bevy game engine
Apache License 2.0
1.18k stars 173 forks source link

Change Entity with Dropdown selection #123

Open ItsDoot opened 1 year ago

ItsDoot commented 1 year ago

Currently entities are displayed in either of 2 ways: a label of the ID, or its name and a dropdown of its components. But there isn't a way to change it to point to a different entity.

How feasible would it be to add an entity selection dropdown adjacent to the ID label / component dropdown? Given a production game/app may have thousands or millions of entities, the design should include a way to use Query filters.

jakobhellermann commented 1 year ago

How about a mode where you can select an entity by searching for its name? It's not as general as a full Query filter, but maybe good enough. Or you could have

struct Data {
  #[inspector(display = EntityDisplay::Select { with_components: vec![TypeId::of<Enemy>()] })
  entity: Entity,
}

and then be able to select one of these entities matching the filtered types.

ItsDoot commented 1 year ago

For my use case, either of name-based search or that simplified component checking would work fine. 👍