aevyrie / bevy_mod_picking

Picking and pointer events for Bevy.
https://crates.io/crates/bevy_mod_picking
Apache License 2.0
784 stars 172 forks source link

HighlightPluginSettings "is_enabled" Private Field #322

Closed CarbonFlora closed 4 months ago

CarbonFlora commented 6 months ago

bevy_mod_picking::highlight::HighlightPluginSettings field, "is_enabled" is private. I am presuming this should be a public field, so you are able to ResMut and change this field.

Example:

fn camera_startup(
    foo: ResMut<bevy_mod_picking::highlight::HighlightPluginSettings>,
) {
    *foo.into_inner() = bevy_mod_picking::highlight::HighlightPluginSettings { is_enabled: false };
}

Solution:

Change the struct to..

/// A resource used to enable or disable picking highlighting.
#[derive(Resource, Debug, Reflect)]
#[reflect(Resource, Default)]
pub struct HighlightPluginSettings {
    /// Should highlighting systems run?
    pub is_enabled: bool,
}