Files
junisaber/src/components/victory-accuracy-ring.js
2018-10-25 06:06:09 -07:00

17 lines
423 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);
this.el.components['animation'].beginAnimation();
}
});