修复附件类型枚举量的字符串大小写问题
This commit is contained in:
@@ -51,6 +51,17 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
|
|||||||
[RotateMode.ChainScale] = "chainScale",
|
[RotateMode.ChainScale] = "chainScale",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static readonly Dictionary<AttachmentType, string> 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 BinaryReader reader = null;
|
||||||
private JsonObject root = null;
|
private JsonObject root = null;
|
||||||
private bool nonessential = false;
|
private bool nonessential = false;
|
||||||
@@ -298,7 +309,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
|
|||||||
var name = reader.ReadStringRef() ?? keyName;
|
var name = reader.ReadStringRef() ?? keyName;
|
||||||
var type = (AttachmentType)reader.ReadByte();
|
var type = (AttachmentType)reader.ReadByte();
|
||||||
attachment["name"] = name;
|
attachment["name"] = name;
|
||||||
attachment["type"] = type.ToString();
|
attachment["type"] = AttachmentTypeJsonValue[type];
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AttachmentType.Region:
|
case AttachmentType.Region:
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
|
|||||||
private static readonly Dictionary<AttachmentType, string> AttachmentTypeJsonValue = new()
|
private static readonly Dictionary<AttachmentType, string> AttachmentTypeJsonValue = new()
|
||||||
{
|
{
|
||||||
[AttachmentType.Region] = "region",
|
[AttachmentType.Region] = "region",
|
||||||
[AttachmentType.Boundingbox] = "boundingBox",
|
[AttachmentType.Boundingbox] = "boundingbox",
|
||||||
[AttachmentType.Mesh] = "mesh",
|
[AttachmentType.Mesh] = "mesh",
|
||||||
[AttachmentType.Linkedmesh] = "linkedMesh",
|
[AttachmentType.Linkedmesh] = "linkedmesh",
|
||||||
[AttachmentType.Path] = "path",
|
[AttachmentType.Path] = "path",
|
||||||
[AttachmentType.Point] = "point",
|
[AttachmentType.Point] = "point",
|
||||||
[AttachmentType.Clipping] = "clipping",
|
[AttachmentType.Clipping] = "clipping",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
|
|||||||
[AttachmentType.Region] = "region",
|
[AttachmentType.Region] = "region",
|
||||||
[AttachmentType.Boundingbox] = "bounding",
|
[AttachmentType.Boundingbox] = "bounding",
|
||||||
[AttachmentType.Mesh] = "mesh",
|
[AttachmentType.Mesh] = "mesh",
|
||||||
[AttachmentType.Linkedmesh] = "linkedMesh",
|
[AttachmentType.Linkedmesh] = "linkedmesh",
|
||||||
[AttachmentType.Path] = "path",
|
[AttachmentType.Path] = "path",
|
||||||
[AttachmentType.Point] = "point",
|
[AttachmentType.Point] = "point",
|
||||||
[AttachmentType.Clipping] = "clipping",
|
[AttachmentType.Clipping] = "clipping",
|
||||||
|
|||||||
Reference in New Issue
Block a user