Skip to content
This repository has been archived by the owner on Mar 4, 2025. It is now read-only.

HighlightPluginSettings "is_enabled" Private Field #322

Closed
CarbonFlora opened this issue Mar 26, 2024 · 0 comments · Fixed by #335
Closed

HighlightPluginSettings "is_enabled" Private Field #322

CarbonFlora opened this issue Mar 26, 2024 · 0 comments · Fixed by #335

Comments

@CarbonFlora
Copy link

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,
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant