Files
junisaber/src/components/victory-accuracy-ring.js
2018-11-14 18:33:04 +01:00

17 lines
429 B
JavaScript

/**
* Trigger accuracy ring animation on victory screen.
*/
AFRAME.registerComponent('victory-accuracy-ring', {
dependencies: ['geometry', 'material'],
schema: {
accuracy: {default: 0}
},
update: function () {
this.el.getObject3D('mesh').material.uniforms.progress.value = 0;
this.el.setAttribute('animation', 'to', this.data.accuracy / 100);
this.el.components['animation'].beginAnimation();
}
});