differentiate play/pause vs. resume for beat generate
This commit is contained in:
@@ -228,6 +228,7 @@ AFRAME.registerComponent('beat-loader', {
|
||||
this.orientations[noteInfo._cutDirection]);
|
||||
|
||||
beatEl.play();
|
||||
beatEl.components.beat.onGenerate();
|
||||
};
|
||||
})(),
|
||||
|
||||
|
||||
@@ -85,12 +85,16 @@ AFRAME.registerComponent('beat', {
|
||||
}
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
this.el.object3D.visible = false;
|
||||
this.partLeftEl.object3D.visible = false;
|
||||
this.partRightEl.object3D.visible = false;
|
||||
},
|
||||
|
||||
play: function () {
|
||||
this.blockEl.object3D.visible = true;
|
||||
this.destroyed = false;
|
||||
this.el.object3D.visible = true;
|
||||
this.startPositionZ = this.el.object3D.position.z;
|
||||
this.el.object3D.position.z -= BEAT_WARMUP_OFFSET;
|
||||
},
|
||||
|
||||
tock: function (time, timeDelta) {
|
||||
@@ -120,6 +124,14 @@ AFRAME.registerComponent('beat', {
|
||||
this.returnToPool();
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when summoned by beat-loader.
|
||||
*/
|
||||
onGenerate: function () {
|
||||
this.startPositionZ = this.el.object3D.position.z;
|
||||
this.el.object3D.position.z -= BEAT_WARMUP_OFFSET;
|
||||
},
|
||||
|
||||
initBlock: function () {
|
||||
var el = this.el;
|
||||
var blockEl = this.blockEl = document.createElement('a-entity');
|
||||
@@ -381,12 +393,6 @@ AFRAME.registerComponent('beat', {
|
||||
};
|
||||
})(),
|
||||
|
||||
pause: function () {
|
||||
this.el.object3D.visible = false;
|
||||
this.partLeftEl.object3D.visible = false;
|
||||
this.partRightEl.object3D.visible = false;
|
||||
},
|
||||
|
||||
initCuttingClippingPlanes: function () {
|
||||
this.leftCutPlanePointsWorld = [
|
||||
new THREE.Vector3(),
|
||||
|
||||
Reference in New Issue
Block a user