Function bevy_inspector_egui::bevy_inspector::ui_for_state
source · Expand description
Display state T
and change state on edit
Examples found in repository?
src/quick.rs (line 135)
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
fn state_ui<T: StateData + Reflect>(world: &mut World) {
let egui_context = world
.resource_mut::<bevy_egui::EguiContext>()
.ctx_mut()
.clone();
egui::Window::new(std::any::type_name::<T>())
.resizable(false)
.title_bar(false)
.show(&egui_context, |ui| {
egui::ScrollArea::vertical().show(ui, |ui| {
ui.heading(pretty_type_name::<T>());
bevy_inspector::ui_for_state::<T>(world, ui);
});
});
}