From ec04348ab6a308e129a2a5c27fbe3cb7cbb41c4f Mon Sep 17 00:00:00 2001 From: Umatriz Date: Sat, 7 Sep 2024 13:37:26 +0300 Subject: [PATCH] Add ability to provide custom gizmos config --- crates/bevy_lunex/src/systems.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/bevy_lunex/src/systems.rs b/crates/bevy_lunex/src/systems.rs index 9478130..dd58c45 100644 --- a/crates/bevy_lunex/src/systems.rs +++ b/crates/bevy_lunex/src/systems.rs @@ -33,9 +33,10 @@ pub fn compute_ui( /// * Generic `(M)` - Master data schema struct defining what can be stored in [`UiTree`] /// * Generic `(N)` - Node data schema struct defining what can be stored in [`UiNode`] /// * Generic `(T)` - Marker component grouping entities into one widget type -pub fn debug_draw_gizmo( +/// * Generic `(G)` - `GizmoConfigGroup` that will be used to draw the outlines +pub fn debug_draw_gizmo( mut query: Query<(&UiTree, &GlobalTransform)>, - mut gizmos: Gizmos + mut gizmos: Gizmos ) { for (tree, transform) in &mut query { let list = tree.crawl(); @@ -629,16 +630,16 @@ impl Plugin for UiGenericPlugin { ///# } /// ``` #[derive(Debug, Default, Clone)] -pub struct UiDebugPlugin (PhantomData, PhantomData); -impl UiDebugPlugin { +pub struct UiDebugPlugin (PhantomData, PhantomData, PhantomData); +impl UiDebugPlugin { pub fn new() -> Self { - UiDebugPlugin::(PhantomData, PhantomData) + UiDebugPlugin::(PhantomData, PhantomData, PhantomData) } } -impl Plugin for UiDebugPlugin { +impl Plugin for UiDebugPlugin { fn build(&self, app: &mut App) { app - .add_systems(Update, debug_draw_gizmo::) + .add_systems(Update, debug_draw_gizmo::) .add_systems(Update, debug_print_tree::.after(UiSystems::Compute)); } }