From 3e8d4bf6d7d205437a5ed12c14aae2d5cf160f15 Mon Sep 17 00:00:00 2001 From: yuni Date: Tue, 17 Sep 2024 16:36:01 +0200 Subject: [PATCH] particles: show them only in augmented reality --- src/visual.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/visual.rs b/src/visual.rs index bea5976..2d2099e 100644 --- a/src/visual.rs +++ b/src/visual.rs @@ -128,6 +128,7 @@ pub fn setup( pub fn spawn_effects( mut commands: Commands, + settings: Res, mut er_effect: EventReader, mut materials: ResMut>, mut meshes: ResMut>, @@ -173,6 +174,7 @@ pub fn spawn_effects( let texture = asset_server.load("textures/exhaust.png"); commands.spawn(( IsEffect, + hud::ToggleableHudElement, RigidBody::Kinematic, bevy::pbr::NotShadowCaster, pos, @@ -205,6 +207,11 @@ pub fn spawn_effects( alpha_mode: AlphaMode::Blend, ..Default::default() }), + visibility: if settings.hud_active { + Visibility::Inherited + } else { + Visibility::Hidden + }, ..default() }, ));