Commit e84113da authored by limingzhe's avatar limingzhe

fix: 只有一个动画不播

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