Commit effdea78 authored by asdf's avatar asdf

title按钮 bug

parent 2930ff1b
...@@ -193,7 +193,7 @@ cc.Class({ ...@@ -193,7 +193,7 @@ cc.Class({
}) })
}, },
playAudioQuestion() { playAudioQuestion(isBtn) {
GameData.isAudio = true; GameData.isAudio = true;
let url = this.data.questionList[GameData.questionIndex].questionAudio; let url = this.data.questionList[GameData.questionIndex].questionAudio;
// url = 'http://127.0.0.1/iamflying.mp3'; // url = 'http://127.0.0.1/iamflying.mp3';
...@@ -206,7 +206,9 @@ cc.Class({ ...@@ -206,7 +206,9 @@ cc.Class({
let id = cc.audioEngine.play(clip, false, 1); let id = cc.audioEngine.play(clip, false, 1);
cc.audioEngine.setFinishCallback(id, () => { cc.audioEngine.setFinishCallback(id, () => {
GameData.isAudio = false; GameData.isAudio = false;
if(!isBtn){
this.showRandomQuestion(); this.showRandomQuestion();
}
}) })
}); });
}, },
...@@ -332,7 +334,7 @@ cc.Class({ ...@@ -332,7 +334,7 @@ cc.Class({
buttonListener(button) { buttonListener(button) {
if (button.node.name == 'btnTitle') { if (button.node.name == 'btnTitle') {
if (!GameData.isAudio) { if (!GameData.isAudio) {
this.playAudioQuestion(); this.playAudioQuestion(true);
} }
} else if (button.node.name == 'btnLast') { } else if (button.node.name == 'btnLast') {
this.onTurnLast(); this.onTurnLast();
......
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