Skip to content

Commit

Permalink
#[derive(Reflect)] on GizmoConfig (bevyengine#10483)
Browse files Browse the repository at this point in the history
  • Loading branch information
SludgePhD authored and Ray Redondo committed Jan 9, 2024
1 parent 608997e commit ba876ce
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/bevy_gizmos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use bevy_ecs::{
component::Component,
entity::Entity,
query::{ROQueryItem, Without},
reflect::ReflectComponent,
reflect::{ReflectComponent, ReflectResource},
schedule::IntoSystemConfigs,
system::{
lifetimeless::{Read, SRes},
Expand Down Expand Up @@ -77,7 +77,9 @@ impl Plugin for GizmoPlugin {
fn build(&self, app: &mut bevy_app::App) {
load_internal_asset!(app, LINE_SHADER_HANDLE, "lines.wgsl", Shader::from_wgsl);

app.add_plugins(UniformComponentPlugin::<LineGizmoUniform>::default())
app.register_type::<GizmoConfig>()
.register_type::<AabbGizmoConfig>()
.add_plugins(UniformComponentPlugin::<LineGizmoUniform>::default())
.init_asset::<LineGizmo>()
.add_plugins(RenderAssetPlugin::<LineGizmo>::default())
.init_resource::<LineGizmoHandles>()
Expand Down Expand Up @@ -135,7 +137,8 @@ impl Plugin for GizmoPlugin {
}

/// A [`Resource`] that stores configuration for gizmos.
#[derive(Resource, Clone)]
#[derive(Resource, Clone, Reflect)]
#[reflect(Resource)]
pub struct GizmoConfig {
/// Set to `false` to stop drawing gizmos.
///
Expand Down Expand Up @@ -188,7 +191,7 @@ impl Default for GizmoConfig {
}

/// Configuration for drawing the [`Aabb`] component on entities.
#[derive(Clone, Default)]
#[derive(Clone, Default, Reflect)]
pub struct AabbGizmoConfig {
/// Draws all bounding boxes in the scene when set to `true`.
///
Expand Down

0 comments on commit ba876ce

Please sign in to comment.