Commit e84113da authored by limingzhe's avatar limingzhe

fix: 只有一个动画不播

parent 6fd8b76c
......@@ -153,23 +153,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
getJumpFrame() {
const maxDisFrame = this.data.frame * 2;
const arr = this.data.stepArr;
let disFrame = 0;
if (arr.length <= 1) {
return maxDisFrame;
}
let disFrame = maxDisFrame;
for (let i=1; i<arr.length; i++) {
const curDis = arr[i].text - arr[i-1].text;
if (!disFrame || disFrame > curDis) {
const curDis = (arr[i].text - arr[i-1].text) / 2;
if (disFrame > curDis) {
disFrame = curDis;
}
}
disFrame /= 2;
const maxDisFrame = this.data.frame * 2;
if (disFrame > maxDisFrame) {
disFrame = maxDisFrame
}
return disFrame;
}
......@@ -521,7 +521,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
})
dragonDisplay.on(dragonBones.EventObject.COMPLETE, (e) => {
if (this.isLast) {
if (this.isLast && this.playTimes > 0) {
this.showGoodjob();
} else {
this.animPlayEnd();
......
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