super-hands
Version:
All-in-one natural hand controller interaction component for A-Frame.
20 lines (19 loc) • 552 B
JavaScript
// common code used in customizing reaction components by button
module.exports = (function () {
function buttonIsValid (evt, buttonList) {
return buttonList.length === 0 ||
buttonList.indexOf(evt.detail.buttonEvent.type) !== -1
}
return {
schema: {
startButtons: { default: [] },
endButtons: { default: [] }
},
startButtonOk: function (evt) {
return buttonIsValid(evt, this.data.startButtons)
},
endButtonOk: function (evt) {
return buttonIsValid(evt, this.data.endButtons)
}
}
})()