Commit 671eabdf authored by limingzhe's avatar limingzhe

fix: 按钮状态调整

parent cca8e0c6
No preview for this file type
...@@ -634,7 +634,7 @@ cc.Class({ ...@@ -634,7 +634,7 @@ cc.Class({
const layer = new cc.Node(); const layer = new cc.Node();
layer.x = -this.canvas.width / 2 + 10; layer.x = -this.canvas.width / 2 + 10;
layer.y = this.canvas.height / 2 - 10; layer.y = this.canvas.height / 2 - 10;
// layer.active = false; layer.active = false;
const sample = getSprNode('sample'); const sample = getSprNode('sample');
sample.anchorX = 0; sample.anchorX = 0;
...@@ -777,6 +777,9 @@ cc.Class({ ...@@ -777,6 +777,9 @@ cc.Class({
this.playAni('begin', 0) this.playAni('begin', 0)
//播放引导音频1 //播放引导音频1
playAudioByUrl(this.data.write_big_0_audio_url, () => { playAudioByUrl(this.data.write_big_0_audio_url, () => {
if (this.isDestroy) {
return;
}
playEnd(); playEnd();
}) })
}, },
...@@ -815,6 +818,9 @@ cc.Class({ ...@@ -815,6 +818,9 @@ cc.Class({
this.playAni('begin', 0) this.playAni('begin', 0)
//播放引导音频1 //播放引导音频1
playAudioByUrl(this.data.write_big_1_audio_url, () => { playAudioByUrl(this.data.write_big_1_audio_url, () => {
if (this.isDestroy) {
return;
}
playEnd(); playEnd();
}) })
}, },
...@@ -829,6 +835,9 @@ cc.Class({ ...@@ -829,6 +835,9 @@ cc.Class({
playAudio(this.audioTip3.clip, () => { playAudio(this.audioTip3.clip, () => {
if (this.isDestroy) {
return;
}
// }) // })
//播放引导音频3 //播放引导音频3
// this.playAudioByUrl(this.data.guideAudioUrl3, () => { // this.playAudioByUrl(this.data.guideAudioUrl3, () => {
...@@ -1056,6 +1065,9 @@ cc.Class({ ...@@ -1056,6 +1065,9 @@ cc.Class({
this.playAudioByUrl(this.data.exercises.audioUrl, () => { this.playAudioByUrl(this.data.exercises.audioUrl, () => {
if (this.isDestroy) {
return;
}
//停止监听动画 //停止监听动画
this._stopAni = true; this._stopAni = true;
...@@ -1167,6 +1179,10 @@ cc.Class({ ...@@ -1167,6 +1179,10 @@ cc.Class({
//播放引导音频2 //播放引导音频2
this.playAudioByUrl(this.data.guideAudioUrl2, () => { this.playAudioByUrl(this.data.guideAudioUrl2, () => {
if (this.isDestroy) {
return;
}
state.stop(); state.stop();
this.playAni('normal', 0); this.playAni('normal', 0);
...@@ -1522,6 +1538,9 @@ cc.Class({ ...@@ -1522,6 +1538,9 @@ cc.Class({
}, },
playAudioStep3() { playAudioStep3() {
if (this.isDestroy) {
return;
}
this.beginShowAudioSmall(); this.beginShowAudioSmall();
}, },
...@@ -1651,6 +1670,9 @@ cc.Class({ ...@@ -1651,6 +1670,9 @@ cc.Class({
this.playAni('begin', 0) this.playAni('begin', 0)
playAudioByUrl(this.data.write_small_0_audio_url, () => { playAudioByUrl(this.data.write_small_0_audio_url, () => {
if (this.isDestroy) {
return;
}
playEnd(); playEnd();
}) })
}, },
...@@ -1687,6 +1709,9 @@ cc.Class({ ...@@ -1687,6 +1709,9 @@ cc.Class({
this.playAni('begin', 0) this.playAni('begin', 0)
//播放引导音频1 //播放引导音频1
playAudioByUrl(this.data.write_small_1_audio_url, () => { playAudioByUrl(this.data.write_small_1_audio_url, () => {
if (this.isDestroy) {
return;
}
playEnd(); playEnd();
}) })
}, },
...@@ -3238,6 +3263,7 @@ cc.Class({ ...@@ -3238,6 +3263,7 @@ cc.Class({
_intervalIds: null, _intervalIds: null,
// 生命周期 // 生命周期
onDestroy() { onDestroy() {
this.isDestroy = true;
this._timeoutIds.forEach(id => { this._timeoutIds.forEach(id => {
clearTimeout(id); clearTimeout(id);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment