Commit 830e03dd authored by Tt's avatar Tt

修改

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