fix bug
This commit is contained in:
@@ -1093,6 +1093,25 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
|
||||
writer.WriteVarInt(name2idx[(string)name]);
|
||||
}
|
||||
|
||||
public override JsonObject ReadJson(string jsonPath)
|
||||
{
|
||||
// replace 3.8.75 to another version to avoid detection in official runtime
|
||||
var root = base.ReadJson(jsonPath);
|
||||
var skeleton = root["skeleton"].AsObject();
|
||||
var version = (string)skeleton["spine"];
|
||||
if (version == "3.8.75") skeleton["spine"] = "3.8.76";
|
||||
return root;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonObject root, string jsonPath)
|
||||
{
|
||||
// replace 3.8.75 to another version to avoid detection in official runtime
|
||||
var skeleton = root["skeleton"].AsObject();
|
||||
var version = (string)skeleton["spine"];
|
||||
if (version == "3.8.75") skeleton["spine"] = "3.8.76";
|
||||
base.WriteJson(root, jsonPath);
|
||||
}
|
||||
|
||||
public override JsonObject ToVersion(JsonObject root, Version version)
|
||||
{
|
||||
root = version switch
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace SpineViewer.Spine
|
||||
/// <summary>
|
||||
/// 读取 Json 对象
|
||||
/// </summary>
|
||||
public JsonObject ReadJson(string jsonPath)
|
||||
public virtual JsonObject ReadJson(string jsonPath)
|
||||
{
|
||||
using var input = File.OpenRead(jsonPath);
|
||||
if (JsonNode.Parse(input) is JsonObject root)
|
||||
@@ -104,7 +104,7 @@ namespace SpineViewer.Spine
|
||||
/// <summary>
|
||||
/// 写入 Json 对象
|
||||
/// </summary>
|
||||
public void WriteJson(JsonObject root, string jsonPath)
|
||||
public virtual void WriteJson(JsonObject root, string jsonPath)
|
||||
{
|
||||
using var output = File.Create(jsonPath);
|
||||
using var writer = new Utf8JsonWriter(output, jsonWriterOptions);
|
||||
|
||||
Reference in New Issue
Block a user