Commit ff110393 authored by asdf's avatar asdf

.

parent 1cb73eba
......@@ -251,17 +251,19 @@ cc.Class({
},
playLabelGreen(cb) {
GameData.audioCount++;
this.dragonBone.playAnimation(this.animationName, 1);
let dragonbonesDone = false;
let audioDone = false;
this.dragonBone.once(dragonBones.EventObject.COMPLETE,()=>{
this.dragonBone.once(dragonBones.EventObject.COMPLETE, () => {
dragonbonesDone = true;
if(audioDone){
if (audioDone) {
cb && cb();
GameData.audioCount--;
}
});
this.playAudioOption((duration) => {
if(!cc.isValid(this)){
if (!cc.isValid(this)) {
return;
}
this.scheduleStep = 2;
......@@ -282,9 +284,8 @@ cc.Class({
}, () => {
this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudioOn;
GameData.isAudio = false;
audioDone = true;
if(dragonbonesDone){
if (dragonbonesDone) {
cb && cb();
}
});
......@@ -329,7 +330,6 @@ cc.Class({
}, () => {
this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudioOn;
GameData.isAudio = false;
});
},
......
......@@ -493,7 +493,6 @@ cc.Class({
this.playAudioPage(true,() => {
this.unschedule(this.changeAudioSpfCb)
this.sprAudio.spriteFrame = this.spfAudio[1];
GameData.isAudio = false;
});
},
......
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