Commit 528f74f4 authored by 李维's avatar 李维

修复部分音频不播放动画的问题

parent 3447ae7f
......@@ -436,9 +436,11 @@ cc.Class({
let btn_picture = pg.view.find(this, "btn_picture");
// 一局失败弹出tryagain,同时下方录音按钮明亮并出现提示
this.setMaoAni("wrong");
this.playSFX("audio_tryagain").then(() => {
pg.view.visible(bg_tryagain, false);
pg.view.visible(end, false);
this.setMaoAni("normal");
})
pg.view.visible(end, true);
pg.view.visible(bg_tryagain, true);
......@@ -448,9 +450,12 @@ cc.Class({
this._playing = true;
this._tryagainCount++;
this._timeoutIds.push(setTimeout(() => {
this.setMaoAni("begin");
if (this._tryagainCount == 1) {
pg.audio.playAudioByUrl(this._tryagain.one).then(() => {
this.setMaoAni("normal");
this._playing = false;
})
// this.playSFX("audio_record");
......@@ -463,6 +468,7 @@ cc.Class({
action.start();
} else if (this._tryagainCount == 2) {
pg.audio.playAudioByUrl(this._tryagain.two).then(() => {
this.setMaoAni("normal");
this._playing = false;
})
// this.playSFX("audio_record");
......@@ -475,11 +481,12 @@ cc.Class({
action.start();
} else {
pg.audio.playAudioByUrl(this._tryagain.three).then(() => {
this.setMaoAni("normal");
this._playing = false;
this.nextStage();
})
}
}, 1000 * 1));
}, 1000 * 2));
},
state5Finish() {
let btn_replay = pg.view.find(this, "btn_replay")
......@@ -647,7 +654,9 @@ cc.Class({
resolve("");
} else {
this._audio_record = true;
this.setMaoAni("begin");
pg.audio.playAudioByUrl(this._cat.record).then(() => {
this.setMaoAni("normal");
this._playing = false;
resolve('');
})
......@@ -869,6 +878,7 @@ cc.Class({
//按钮触发,使用的方法
onTouchRecord() {
if (this._playing) {
this.setMaoAni("normal")
cc.audioEngine.stopAllEffects();
}
this.playSFX("audio_btns");
......
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