Skip to content

Commit

Permalink
dev tool helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
matiqo15 committed Mar 11, 2024
1 parent 9e18452 commit 2b5cef5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions crates/bevy_dev_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,29 @@ impl DevToolId {
pub struct DevTool {
/// Identifier of a dev tool.
pub id: DevToolId,
/// State of the dev tool.
pub is_enabled: bool,
is_enabled: bool,
}

impl DevTool {
/// Returns true if [`DevTool`] is enabled.
pub fn is_enabled(&self) -> bool {
self.is_enabled
}

/// Enables [`DevTool`].
pub fn enable(&mut self) {
self.is_enabled = true;
}

/// Disables
pub fn disable(&mut self) {
self.is_enabled = false;
}

/// Toggles [`DevTool`].
pub fn toggle(&mut self) {
self.is_enabled = !self.is_enabled;
}
}

impl DevTool {
Expand Down

0 comments on commit 2b5cef5

Please sign in to comment.