diff --git a/spine-csharp/src/Attachments/MeshAttachment.cs b/spine-csharp/src/Attachments/MeshAttachment.cs index 0e74083f2..0a5fe495d 100644 --- a/spine-csharp/src/Attachments/MeshAttachment.cs +++ b/spine-csharp/src/Attachments/MeshAttachment.cs @@ -164,8 +164,7 @@ namespace Spine { copy.g = g; copy.b = b; copy.a = a; - copy.deformAttachment = deformAttachment; - + CopyTo(copy); copy.regionUVs = new float[regionUVs.Length]; Array.Copy(regionUVs, 0, copy.regionUVs, 0, regionUVs.Length); diff --git a/spine-csharp/src/Attachments/VertexAttachment.cs b/spine-csharp/src/Attachments/VertexAttachment.cs index d5ffb183f..3f7a4e390 100644 --- a/spine-csharp/src/Attachments/VertexAttachment.cs +++ b/spine-csharp/src/Attachments/VertexAttachment.cs @@ -150,6 +150,7 @@ namespace Spine { attachment.vertices = null; attachment.worldVerticesLength = worldVerticesLength; + attachment.deformAttachment = deformAttachment; } } } diff --git a/spine-csharp/src/Skin.cs b/spine-csharp/src/Skin.cs index e7c7f099d..0ec045a59 100644 --- a/spine-csharp/src/Skin.cs +++ b/spine-csharp/src/Skin.cs @@ -83,9 +83,10 @@ namespace Spine { foreach (SkinEntry entry in skin.attachments.Keys) { if (entry.Attachment is MeshAttachment) - SetAttachment(entry.SlotIndex, entry.Name, ((MeshAttachment)entry.Attachment).NewLinkedMesh()); + SetAttachment(entry.SlotIndex, entry.Name, + entry.Attachment != null ? ((MeshAttachment)entry.Attachment).NewLinkedMesh() : null); else - SetAttachment(entry.SlotIndex, entry.Name, entry.Attachment.Copy()); + SetAttachment(entry.SlotIndex, entry.Name, entry.Attachment != null ? entry.Attachment.Copy() : null); } }