fix cursor mesh toggling
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user