From 49f6b28aef836b2427612915238b790ec39d7bf9 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:05:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=99=84=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=9E=9A=E4=B8=BE=E9=87=8F=E7=9A=84=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=A4=A7=E5=B0=8F=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SkeletonConverter/SkeletonConverter38.cs | 13 ++++++++++++- .../SkeletonConverter/SkeletonConverter41.cs | 4 ++-- .../SkeletonConverter/SkeletonConverter42.cs | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs index 7db42cb..01c018e 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs @@ -51,6 +51,17 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter [RotateMode.ChainScale] = "chainScale", }; + private static readonly Dictionary AttachmentTypeJsonValue = new() + { + [AttachmentType.Region] = "region", + [AttachmentType.Boundingbox] = "bounding", + [AttachmentType.Mesh] = "mesh", + [AttachmentType.Linkedmesh] = "linkedmesh", + [AttachmentType.Path] = "path", + [AttachmentType.Point] = "point", + [AttachmentType.Clipping] = "clipping", + }; + private BinaryReader reader = null; private JsonObject root = null; private bool nonessential = false; @@ -298,7 +309,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter var name = reader.ReadStringRef() ?? keyName; var type = (AttachmentType)reader.ReadByte(); attachment["name"] = name; - attachment["type"] = type.ToString(); + attachment["type"] = AttachmentTypeJsonValue[type]; switch (type) { case AttachmentType.Region: diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs index bf25958..c08316a 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs @@ -52,9 +52,9 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter private static readonly Dictionary AttachmentTypeJsonValue = new() { [AttachmentType.Region] = "region", - [AttachmentType.Boundingbox] = "boundingBox", + [AttachmentType.Boundingbox] = "boundingbox", [AttachmentType.Mesh] = "mesh", - [AttachmentType.Linkedmesh] = "linkedMesh", + [AttachmentType.Linkedmesh] = "linkedmesh", [AttachmentType.Path] = "path", [AttachmentType.Point] = "point", [AttachmentType.Clipping] = "clipping", diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs index 47aa5d0..891bf31 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs @@ -52,7 +52,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter [AttachmentType.Region] = "region", [AttachmentType.Boundingbox] = "bounding", [AttachmentType.Mesh] = "mesh", - [AttachmentType.Linkedmesh] = "linkedMesh", + [AttachmentType.Linkedmesh] = "linkedmesh", [AttachmentType.Path] = "path", [AttachmentType.Point] = "point", [AttachmentType.Clipping] = "clipping",