particles: show them only in augmented reality

This commit is contained in:
yuni 2024-09-17 16:36:01 +02:00
parent fbc416796e
commit 3e8d4bf6d7

View file

@ -128,6 +128,7 @@ pub fn setup(
pub fn spawn_effects(
mut commands: Commands,
settings: Res<var::Settings>,
mut er_effect: EventReader<SpawnEffectEvent>,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
@ -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()
},
));