Commit 3f084fb1 authored by Chen Jiping's avatar Chen Jiping

fix:修复结束后,再点击猫咪不播放音频问题

parent 8ad5ad63
...@@ -337,6 +337,9 @@ cc.Class({ ...@@ -337,6 +337,9 @@ cc.Class({
catBtn.addComponent(cc.Button); catBtn.addComponent(cc.Button);
catBtn.on('click', () => { catBtn.on('click', () => {
console.log(this._canClickCat, this._showStandby);
if(!this._cantouch){ if(!this._cantouch){
return; return;
} }
...@@ -353,6 +356,9 @@ cc.Class({ ...@@ -353,6 +356,9 @@ cc.Class({
const clickCat = (audioUrl, aniName) =>{ const clickCat = (audioUrl, aniName) =>{
console.log(audioUrl, aniName);
//播放待机音频 //播放待机音频
if(audioUrl){ if(audioUrl){
...@@ -366,7 +372,7 @@ cc.Class({ ...@@ -366,7 +372,7 @@ cc.Class({
}); });
} }
else{ else{
this.playAni(aniName, 1, () => { this.playAni(aniName, 0, () => {
this._showStandby = false; this._showStandby = false;
}); });
} }
...@@ -379,7 +385,7 @@ cc.Class({ ...@@ -379,7 +385,7 @@ cc.Class({
} }
else{ else{
clickCat(this.data.guideAudioUrl2, 'normal'); clickCat(this.data.guideAudioUrl2, 'begin');
} }
}); });
...@@ -407,6 +413,7 @@ cc.Class({ ...@@ -407,6 +413,7 @@ cc.Class({
.call(() => { .call(() => {
if(times > 2){ if(times > 2){
this._cantouch = true; this._cantouch = true;
this._showStandby = false;
return; return;
} }
...@@ -793,11 +800,13 @@ cc.Class({ ...@@ -793,11 +800,13 @@ cc.Class({
if(duration - currentTime > 0.6){ if(duration - currentTime > 0.6){
this.textTwinkle(node); this.textTwinkle(node);
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
this._showStandby = false;
showNext(); showNext();
}); });
} }
else{ else{
this.textTwinkle(node, () => { this.textTwinkle(node, () => {
this._showStandby = false;
showNext(); showNext();
}); });
} }
...@@ -870,6 +879,7 @@ cc.Class({ ...@@ -870,6 +879,7 @@ cc.Class({
.to(0.5, { scale: node.initScale }) .to(0.5, { scale: node.initScale })
.call(() => { .call(() => {
this._cantouch = true; this._cantouch = true;
if(this._shown){ if(this._shown){
return; return;
} }
......
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