reset timeouts and scheduled audio param changes after game over

This commit is contained in:
Kevin Ngo
2018-10-22 01:41:16 -07:00
parent 6797660c66
commit 2743579f8d
2 changed files with 22 additions and 11 deletions

View File

@@ -457,7 +457,7 @@ AFRAME.registerComponent('beat', {
const hand = saberEls[i].getAttribute('saber-controls').hand;
if (hitBoundingBox && saberBoundingBox.intersectsBox(hitBoundingBox)) {
if (saberEls[i].components['saber-controls'].swinging &&
this.data.color === saberColors[saberEls[i].getAttribute('saber-controls').hand]) {
this.data.color === saberColors[hand]) {
this.el.emit('beathit', null, true);
this.el.emit(`beathit${hand}`, null, true);
} else {
@@ -478,7 +478,7 @@ AFRAME.registerComponent('beat', {
}
if (this.data.type === 'dot' && saberEls[i].components['saber-controls'].swinging &&
this.data.color === saberColors[saberEls[i].getAttribute('saber-controls').hand]) {
this.data.color === saberColors[hand]) {
this.el.emit('beathit', null, true);
this.el.emit(`beathit${hand}`, null, true);
} else {