Commit 93e104fc authored by 范雪寒's avatar 范雪寒

fix: 进场音效播放问题;按钮不可用状态问题;

parent 8c1224c7
This diff is collapsed.
......@@ -56,4 +56,4 @@
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
}
\ No newline at end of file
}
......@@ -97,7 +97,7 @@ cc.Class({
this._onLoadFinishFunc();
}
this.showQuestion();
this.showQuestion(true);
},
initStatus() {
......@@ -120,22 +120,25 @@ cc.Class({
initListeners() {
addButtonListener(cc.find('Canvas/BtnNode/BtnBefore'), () => {
if (this.status.currentQuestionIdx <= 0) {
return;
return false;
}
this.status.currentQuestionIdx--;
this.showQuestion();
return true;
});
addButtonListener(cc.find('Canvas/BtnNode/BtnNext'), () => {
if (this.status.currentQuestionIdx + 1 >= this.data.questionList.length) {
return;
return false;
}
this.status.currentQuestionIdx++;
this.showQuestion();
return true;
});
addButtonListener(cc.find('Canvas/BtnNode/BtnRefresh'), () => {
this.showQuestion();
return true;
});
cc.find('Canvas/bgFrount/leef/TittleLabelNode').on('click', () => {
......@@ -151,11 +154,13 @@ cc.Class({
},
async showQuestion() {
async showQuestion(isFirstIncome = false) {
this.showOptions();
this.questionBoardDown();
await this.playIncomeAudio();
await asyncDelay(1);
if (isFirstIncome) {
await this.playIncomeAudio();
await asyncDelay(1);
}
this.playQuestionAudio();
},
......
......@@ -242,8 +242,10 @@ export function addButtonListener(btnNode, func) {
}
btnNode.canNotClick = true;
playEffect('按钮');
await func(btn);
await jelly(btnNode);
const result = await func(btn);
if (result) {
await jelly(btnNode);
}
btnNode.canNotClick = false;
});
}
......
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