Commit 873ba418 authored by 范雪寒's avatar 范雪寒

feat: 结尾 音频

parent 5fd800fc
...@@ -166,6 +166,7 @@ cc.Class({ ...@@ -166,6 +166,7 @@ cc.Class({
.start(); .start();
}, },
coolCatAlreadySpeakEnd: null,
async createItem(itemData, bg) { async createItem(itemData, bg) {
const bgScale = bg.width / this.data.bgItem.rect.width; const bgScale = bg.width / this.data.bgItem.rect.width;
...@@ -176,10 +177,13 @@ cc.Class({ ...@@ -176,10 +177,13 @@ cc.Class({
item.clicked = true; item.clicked = true;
this.shakeItem(item); this.shakeItem(item);
await this.asyncPlayAudioByUrl(itemData.audio_url); await this.asyncPlayAudioByUrl(itemData.audio_url);
if (this.itemList.every(tmpItem => tmpItem.clicked)) { if (!this.coolCatAlreadySpeakEnd) {
await asyncDelay(0.3); if (this.itemList.every(tmpItem => tmpItem.clicked)) {
await this.coolCatSpeakEnd(); this.coolCatAlreadySpeakEnd = true;
onHomeworkFinish(); await asyncDelay(0.3);
await this.coolCatSpeakEnd();
onHomeworkFinish();
}
} }
}); });
......
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