Commit 7c190ce0 authored by 李维's avatar 李维

把异步操作加到数组中

parent 0496df09
...@@ -258,10 +258,12 @@ cc.Class({ ...@@ -258,10 +258,12 @@ cc.Class({
nextBtn.on(cc.Node.EventType.TOUCH_END, this.onTouchPanelRight, this) nextBtn.on(cc.Node.EventType.TOUCH_END, this.onTouchPanelRight, this)
}, },
checkShowArrowBtn() { checkShowArrowBtn() {
setTimeout(() => { this._timeoutIds.push(setTimeout(() => {
this.lastBtn.active = !this.nodeDict.btnLast.children[1].active; if(this.nodeDict) {
this.nextBtn.active = !this.nodeDict.btnNext.children[1].active; this.lastBtn.active = !this.nodeDict.btnLast.children[1].active;
}, 220); this.nextBtn.active = !this.nodeDict.btnNext.children[1].active;
}
}, 220))
}, },
autoPlay() { autoPlay() {
this.inited = true; this.inited = true;
...@@ -437,10 +439,10 @@ cc.Class({ ...@@ -437,10 +439,10 @@ cc.Class({
const cat = cc.find('Canvas/mao'); const cat = cc.find('Canvas/mao');
playDragonBoneAnimation(cat, 'finish', 0); playDragonBoneAnimation(cat, 'finish', 0);
this.playAudioByUrl(this.data.endAudio, () => { this.playAudioByUrl(this.data.endAudio, () => {
setTimeout(() => { this._timeoutIds.push(setTimeout(() => {
playDragonBoneAnimation(cat, 'normal', -1); playDragonBoneAnimation(cat, 'normal', -1);
cb(); cb();
}, 500); }, 500))
}); });
}, },
......
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