From 927d0706a58e7721578a14772c23148673c202b6 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 15 Oct 2018 14:54:04 -0700 Subject: [PATCH] fix cursor mesh visibility --- src/index.html | 4 ++-- src/state/index.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index 25c982c..83a35bf 100644 --- a/src/index.html +++ b/src/index.html @@ -216,8 +216,8 @@ {% endmacro %} diff --git a/src/state/index.js b/src/state/index.js index 4c02d2b..2c0e219 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -259,8 +259,11 @@ AFRAME.registerState({ state.isPlaying = !state.menu.active && !state.isPaused && !state.isVictory && !state.isGameOver && !state.challenge.isLoading && !state.isSongLoading; - state.leftRaycasterActive = !state.isPlaying && state.activeHand === 'left' && state.inVR; - state.rightRaycasterActive = !state.isPlaying && state.activeHand === 'right' && state.inVR; + + const anyMenuOpen = state.menu.active || state.isPaused || state.isVictory || state.isGameOver; + state.leftRaycasterActive = anyMenuOpen && state.activeHand === 'left' && state.inVR; + state.rightRaycasterActive = anyMenuOpen && state.activeHand === 'right' && state.inVR; + state.multiplierText = `${state.score.multiplier}x`; } });