Skip to content
Snippets Groups Projects
Unverified Commit 8338a638 authored by databasedav's avatar databasedav Committed by GitHub
Browse files

add disabling resource (#156)

parent 1e4714e5
No related branches found
No related tags found
No related merge requests found
......@@ -10,11 +10,20 @@ pub struct CursorSet;
pub struct CursorPlugin;
/// Unit resource whose existence in the world disables the cursor plugin systems.
#[derive(Resource)]
pub struct CursorPluginDisabled;
impl Plugin for CursorPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, ((hover_sprites, hover_ui), change_cursor).chain())
.add_event::<TextHoverIn>()
.add_event::<TextHoverOut>();
app.add_systems(
Update,
((hover_sprites, hover_ui), change_cursor)
.chain()
.run_if(not(resource_exists::<CursorPluginDisabled>)),
)
.add_event::<TextHoverIn>()
.add_event::<TextHoverOut>();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment