Commit 89fadf95 authored by 章红平's avatar 章红平

提交

parent 132f1374
No preview for this file type
......@@ -400,6 +400,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
cc.audioEngine.stopAll();
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
......
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