Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[derive(Reflect)] on GizmoConfig #10483

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/bevy_gizmos/src/lib.rs
Original file line number Diff line number Diff line change
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,7 @@ impl Plugin for GizmoPlugin {
}

/// A [`Resource`] that stores configuration for gizmos.
#[derive(Resource, Clone)]
#[derive(Resource, Clone, Reflect)]
SludgePhD marked this conversation as resolved.
Show resolved Hide resolved
pub struct GizmoConfig {
/// Set to `false` to stop drawing gizmos.
///
Expand Down Expand Up @@ -188,7 +190,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