fix difficulty menu raycastability updates
This commit is contained in:
17
src/components/difficulty-background.js
Normal file
17
src/components/difficulty-background.js
Normal 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');
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user