diff --git a/src/components/cursor-mesh.js b/src/components/cursor-mesh.js index c610385..9edbaa7 100644 --- a/src/components/cursor-mesh.js +++ b/src/components/cursor-mesh.js @@ -3,6 +3,7 @@ */ AFRAME.registerComponent('cursor-mesh', { schema: { + active: {default: true}, cursorEl: {type: 'selector'} }, @@ -10,6 +11,10 @@ AFRAME.registerComponent('cursor-mesh', { this.scenePivotEl = document.getElementById('scenePivot'); }, + update: function () { + this.el.object3D.visible = this.data.active; + }, + tick: function () { var cursor; var cursorEl = this.data.cursorEl; @@ -21,6 +26,8 @@ AFRAME.registerComponent('cursor-mesh', { var object3D = this.el.object3D; var scenePivotEl = this.scenePivotEl; + if (!this.data.active) { return; } + cursor = cursorEl.components.cursor; if (!cursor) { return; } diff --git a/src/index.html b/src/index.html index 08fad05..9a8b344 100644 --- a/src/index.html +++ b/src/index.html @@ -204,8 +204,8 @@ {% endmacro %} @@ -217,7 +217,8 @@ {% if not IS_PRODUCTION %} - + {% endif %}