fix difficulty menu raycastability updates

This commit is contained in:
Kevin Ngo
2018-12-11 02:22:24 -08:00
parent f09d59b815
commit 84f93a48d3
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
/**
* Handle difficulty raycastability.
* Needed since state component does not have a bind-toggle that works within a bind-for.
*/
AFRAME.registerComponent('difficulty-background', {
schema: {
enabled: {type: false}
},
update: function () {
if (this.data.enabled) {
this.el.setAttribute('raycastable', '');
} else {
this.el.removeAttribute('raycastable');
}
}
});