Commit 1cb73eba authored by asdf's avatar asdf

骨骼和音频都播放完成之后才判断结束

parent a9937027
...@@ -252,6 +252,14 @@ cc.Class({ ...@@ -252,6 +252,14 @@ cc.Class({
playLabelGreen(cb) { playLabelGreen(cb) {
this.dragonBone.playAnimation(this.animationName, 1); this.dragonBone.playAnimation(this.animationName, 1);
let dragonbonesDone = false;
let audioDone = false;
this.dragonBone.once(dragonBones.EventObject.COMPLETE,()=>{
dragonbonesDone = true;
if(audioDone){
cb && cb();
}
});
this.playAudioOption((duration) => { this.playAudioOption((duration) => {
if(!cc.isValid(this)){ if(!cc.isValid(this)){
return; return;
...@@ -275,7 +283,10 @@ cc.Class({ ...@@ -275,7 +283,10 @@ cc.Class({
this.unschedule(this.changeAudioSpfCb) this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudioOn; this.sprAudio.spriteFrame = this.spfAudioOn;
GameData.isAudio = false; GameData.isAudio = false;
audioDone = true;
if(dragonbonesDone){
cb && cb(); cb && cb();
}
}); });
}, },
playLabelGreenCb() { playLabelGreenCb() {
......
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