Commit 043de7f2 authored by Tt's avatar Tt

音频顺序修改

parent b321010c
......@@ -138,7 +138,7 @@ export default class NewClass extends cc.Component {
.to(0.8, { scale: 0 }, { easing: 'quadOut' })
.call(() => {
pg.event.emit("mouse_num_game_end")
this.playAudio(this.starCountClip);
// this.playAudio(this.starCountClip);
})
.start();
......
This diff is collapsed.
......@@ -278,7 +278,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
this.onTouchCheckCantouch = false;
})
}, 500);
}, 2000);
}
updateCardResult() {
return new Promise((res, rej) => {
......@@ -346,6 +346,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.find(this.layout_lollipop, 'progressbar_highlight').active = false;
let texts = pg.view.find(this.layout_lollipop, 'texts')
pg.audio.playAudioByNode(pg.view.find(texts, 'audio'))
texts.active = true;
let complate = texts.getChildByName("complate");
......
......@@ -481,6 +481,15 @@ let pg = {
});
});
},
playAudioByNode(node) {
const audio = node.getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
},
stopAudio(audioId) {
if (!audioId) return;
cc.audioEngine.stopEffect(audioId);
......
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