Commit 1cb73eba authored by asdf's avatar asdf

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

parent a9937027
......@@ -252,6 +252,14 @@ cc.Class({
playLabelGreen(cb) {
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) => {
if(!cc.isValid(this)){
return;
......@@ -275,7 +283,10 @@ cc.Class({
this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudioOn;
GameData.isAudio = false;
cb && cb();
audioDone = true;
if(dragonbonesDone){
cb && cb();
}
});
},
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