victory accuracy ring

This commit is contained in:
Kevin Ngo
2018-10-25 06:06:09 -07:00
parent 1a67c607de
commit 610ee2bc2a
3 changed files with 31 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
/**
* 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();
}
});