hide mirror lights in jupiter-eclipse

This commit is contained in:
yuni 2024-11-11 23:29:16 +01:00
parent 4296c6ac4b
commit 4ac8b159c1

View file

@ -600,6 +600,7 @@ fn handle_achievement_event(
fn check_achievements(
time: Res<Time>,
q_player: Query<&Position, With<actor::PlayerCamera>>,
mut q_mirrorlight: Query<&mut Visibility, With<actor::MirrorLight>>,
id2pos: Res<Id2Pos>,
mut ew_achievement: EventWriter<AchievementEvent>,
mut timer: ResMut<AchievementCheckTimer>,
@ -633,6 +634,16 @@ fn check_achievements(
if shadowed {
ew_achievement.send(AchievementEvent::InJupitersShadow);
for mut mirrorlight_vis in &mut q_mirrorlight {
*mirrorlight_vis = Visibility::Hidden;
}
} else {
// This is checking for whether the player is shadowed, not the mirror.
// But in the case where these two are not the same, the player doesn't see
// the mirror anyway and the mirror light's visibility state is irrelevant.
for mut mirrorlight_vis in &mut q_mirrorlight {
*mirrorlight_vis = Visibility::Inherited;
}
}
}