Commit 90ce9c4a authored by yu's avatar yu

1

parent 8376e2fb
...@@ -449,11 +449,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -449,11 +449,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
playLocalAudio(audioName) { playLocalAudio(audioName) {
let noStop = audioName == "count"; let noStop = audioName == "count";
if (!noStop) this.stopBgmAdudio(); // if (!noStop) this.stopBgmAdudio();
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource); const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false); const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => { resolve(id); if (!noStop) this.resumeBgmMusic(); }); cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
// if (!noStop) this.resumeBgmMusic();
});
}) })
} }
private bgmId; private bgmId;
......
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