Browse Source

[ts] Port of commit 9d49999: Changed SequenceTimeline to match AttachmentTimeline behavior.

Davide Tantillo 10 months ago
parent
commit
f64b20d17d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      spine-ts/spine-core/src/Animation.ts

+ 6 - 1
spine-ts/spine-core/src/Animation.ts

@@ -30,7 +30,7 @@
 import { VertexAttachment, Attachment } from "./attachments/Attachment.js";
 import { IkConstraint } from "./IkConstraint.js";
 import { PathConstraint } from "./PathConstraint.js";
-import { Physics, Skeleton } from "./Skeleton.js";
+import { Skeleton } from "./Skeleton.js";
 import { Slot } from "./Slot.js";
 import { TransformConstraint } from "./TransformConstraint.js";
 import { StringSet, Utils, MathUtils, NumberArrayLike } from "./Utils.js";
@@ -2330,6 +2330,11 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
 				|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;
 		}
 
+		if (direction == MixDirection.mixOut) {
+			if (blend == MixBlend.setup) slot.sequenceIndex = -1;
+			return;
+		}
+
 		let frames = this.frames;
 		if (time < frames[0]) {
 			if (blend == MixBlend.setup || blend == MixBlend.first) slot.sequenceIndex = -1;