fix cursor mesh visibility

This commit is contained in:
Kevin Ngo
2018-10-15 14:54:04 -07:00
parent e8c61638dd
commit 927d0706a5
2 changed files with 7 additions and 4 deletions

View File

@@ -216,8 +216,8 @@
<a-entity
id="{{ hand }}CursorMesh"
mixin="cursorMesh"
bind__cursor-mesh="active: menu.active && activeHand === '{{ hand }}'"
cursor-mesh="active: menu.active && activeHand === '{{ hand }}'; cursorEl: #{{ hand }}Hand"
bind__cursor-mesh="active: {{ hand }}RaycasterActive"
cursor-mesh="active: {{ hand }}RaycasterActive; cursorEl: #{{ hand }}Hand"
material="color: {{ beamColor }}"
scale="1.3 1.3 1.3"></a-entity>
{% endmacro %}

View File

@@ -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`;
}
});