Commit 830e03dd authored by Tt's avatar Tt

修改

parent f8f97fd8
......@@ -134,22 +134,30 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private a;
onBtnStem() {
if (this.playing != STATE.WAITING) return;
//播放音效,允许后续操作。
this.playing = STATE.AUDIOING;
let btn_stem: cc.Node = pg.view.find(this, "btn_stem");
pg.view.visible(pg.view.find(btn_stem, "icon_hand"), false);
this.updateBtnStem(true);
pg.audio.playAudioByUrl(this.part.stemAudio).then(() => {
if (!this.a) {
this.a = true;
this.playing = STATE.GUIDING;
this.updatePersonGuide();
} else {
this.playing = STATE.AUDIOED;
}
this.updateBtnStem(false);
})
if (this.playing == STATE.WAITING) {
//播放音效,允许后续操作。
this.playing = STATE.AUDIOING;
let btn_stem: cc.Node = pg.view.find(this, "btn_stem");
pg.view.visible(pg.view.find(btn_stem, "icon_hand"), false);
this.updateBtnStem(true);
pg.audio.playAudioByUrl(this.part.stemAudio).then(() => {
if (!this.a) {
this.a = true;
this.playing = STATE.GUIDING;
this.updatePersonGuide();
} else {
this.playing = STATE.AUDIOED;
}
this.updateBtnStem(false);
})
} else {
let btn_stem: cc.Node = pg.view.find(this, "btn_stem");
pg.view.visible(pg.view.find(btn_stem, "icon_hand"), false);
this.updateBtnStem(true);
pg.audio.playAudioByUrl(this.part.stemAudio).then(() => {
this.updateBtnStem(false);
})
}
}
updateList() {
pg.view.visible(pg.view.find(this, "layout_items"), true)
......
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