ソースを参照

[ts] Fix copy constructor of region and mesh attachments

Mario Zechner 3 年 前
コミット
2af8636407

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

@@ -181,7 +181,7 @@ export class MeshAttachment extends VertexAttachment implements HasTextureRegion
 		Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);
 		copy.hullLength = this.hullLength;
 
-		copy.sequence = this.sequence.copy();
+		copy.sequence = this.sequence != null ? this.sequence.copy() : null;
 
 		// Nonessential.
 		if (this.edges) {

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

@@ -193,7 +193,7 @@ export class RegionAttachment extends Attachment implements HasTextureRegion {
 		Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);
 		Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);
 		copy.color.setFromColor(this.color);
-		copy.sequence = this.sequence.copy();
+		copy.sequence = this.sequence != null ? this.sequence.copy() : null;
 		return copy;
 	}