Pārlūkot izejas kodu

[ts] Port of 4efd63f89cb995cbe4f30358d268a9d0eaf0c9be, fix VertexAttachment.timlineAttachment typo.

Mario Zechner 3 gadi atpakaļ
vecāks
revīzija
386ad25ebc

+ 3 - 2
spine-ts/spine-core/src/Animation.ts

@@ -1510,7 +1510,7 @@ export class DeformTimeline extends CurveTimeline implements SlotTimeline {
 		if (!slot.bone.active) return;
 		let slotAttachment: Attachment | null = slot.getAttachment();
 		if (!slotAttachment) return;
-		if (!(slotAttachment instanceof VertexAttachment) || (<VertexAttachment>slotAttachment).timelineAttahment != this.attachment) return;
+		if (!(slotAttachment instanceof VertexAttachment) || (<VertexAttachment>slotAttachment).timelineAttachment != this.attachment) return;
 
 		let deform: Array<number> = slot.deform;
 		if (deform.length == 0) blend = MixBlend.setup;
@@ -2195,7 +2195,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
 		let attachment = this.attachment as unknown as Attachment;
 		if (slotAttachment != attachment) {
 			if (!(slotAttachment instanceof VertexAttachment)
-				|| (slotAttachment as VertexAttachment).timelineAttahment != attachment) return;
+				|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;
 		}
 
 		let frames = this.frames;
@@ -2209,6 +2209,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
 		let modeAndIndex = frames[i + SequenceTimeline.MODE];
 		let delay = frames[i + SequenceTimeline.DELAY];
 
+		if (!this.attachment.sequence) return;
 		let index = modeAndIndex >> 4, count = this.attachment.sequence!.regions.length;
 		let mode = SequenceModeValues[modeAndIndex & 0xf];
 		if (mode != SequenceMode.hold) {

+ 1 - 1
spine-ts/spine-core/src/SkeletonBinary.ts

@@ -238,7 +238,7 @@ export class SkeletonBinary {
 			if (!linkedMesh.parent) throw new Error("Linked mesh parent must not be null");
 			let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
 			if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
-			linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;
+			linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;
 			linkedMesh.mesh.setParentMesh(parent as MeshAttachment);
 			if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();
 		}

+ 1 - 1
spine-ts/spine-core/src/SkeletonJson.ts

@@ -297,7 +297,7 @@ export class SkeletonJson {
 			if (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);
 			let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
 			if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
-			linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? <VertexAttachment>parent : <VertexAttachment>linkedMesh.mesh;
+			linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? <VertexAttachment>parent : <VertexAttachment>linkedMesh.mesh;
 			linkedMesh.mesh.setParentMesh(<MeshAttachment>parent);
 			if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();
 		}

+ 1 - 1
spine-ts/spine-core/src/Slot.ts

@@ -91,7 +91,7 @@ export class Slot {
 	setAttachment (attachment: Attachment | null) {
 		if (this.attachment == attachment) return;
 		if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
-			|| (<VertexAttachment>attachment).timelineAttahment != (<VertexAttachment>this.attachment).timelineAttahment) {
+			|| (<VertexAttachment>attachment).timelineAttachment != (<VertexAttachment>this.attachment).timelineAttachment) {
 			this.deform.length = 0;
 		}
 		this.attachment = attachment;

+ 2 - 2
spine-ts/spine-core/src/attachments/Attachment.ts

@@ -66,7 +66,7 @@ export abstract class VertexAttachment extends Attachment {
 
 	/** Timelines for the timeline attachment are also applied to this attachment.
 	 * May be null if no attachment-specific timelines should be applied. */
-	timelineAttahment: Attachment = this;
+	timelineAttachment: Attachment = this;
 
 	constructor (name: string) {
 		super(name);
@@ -155,6 +155,6 @@ export abstract class VertexAttachment extends Attachment {
 		}
 
 		attachment.worldVerticesLength = this.worldVerticesLength;
-		attachment.timelineAttahment = this.timelineAttahment;
+		attachment.timelineAttachment = this.timelineAttachment;
 	}
 }

+ 1 - 1
spine-ts/spine-core/src/attachments/MeshAttachment.ts

@@ -205,7 +205,7 @@ export class MeshAttachment extends VertexAttachment implements HasTextureRegion
 		let copy = new MeshAttachment(this.name, this.path);
 		copy.region = this.region;
 		copy.color.setFromColor(this.color);
-		copy.timelineAttahment = this.timelineAttahment;
+		copy.timelineAttachment = this.timelineAttachment;
 		copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
 		if (copy.region != null) copy.updateRegion();
 		return copy;