Commit ff110393 authored by asdf's avatar asdf

.

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