Эх сурвалжийг харах

[ts] Fix applying attachment timeline in AnimationState

AnimatinState.setAttachment was directly setting the slot.attachment field instead of calling the setter. This caused the deform array from a previous attachment to linger around and be applied to the current attachment incorrectly.
badlogic 4 жил өмнө
parent
commit
bef00617d7

+ 1 - 7
spine-ts/build/spine-all.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 1 - 7
spine-ts/build/spine-canvas.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 1 - 7
spine-ts/build/spine-core.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 1 - 7
spine-ts/build/spine-player.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-player.js.map


+ 1 - 7
spine-ts/build/spine-threejs.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 1 - 7
spine-ts/build/spine-webgl.js

@@ -1611,7 +1611,7 @@ var spine;
 				slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
 		};
 		AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments)
 				slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		};
@@ -4103,17 +4103,11 @@ var spine;
 					var mesh = attachment;
 					verticesLength = mesh.worldVerticesLength;
 					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					if (i == 43) {
-						console.log("WTF");
-					}
 					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
 				}
 				if (vertices != null) {
 					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
 						var x = vertices[ii], y = vertices[ii + 1];
-						if (isNaN(x) || isNaN(y)) {
-							console.log("WTF");
-						}
 						minX = Math.min(minX, x);
 						minY = Math.min(minY, y);
 						maxX = Math.max(maxX, x);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-webgl.js.map


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

@@ -378,7 +378,7 @@ module spine {
 		}
 
 		setAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string, attachments: boolean) {
-			slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
+			slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
 			if (attachments) slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
 		}
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно