Some fixes for asset parsing via typetree

This commit is contained in:
VaDiM
2024-11-02 01:40:45 +03:00
parent c2095c4e7a
commit fca937e5e6
5 changed files with 12 additions and 8 deletions
@@ -32,7 +32,7 @@ namespace AssetStudio
}
else
{
writer.WriteNumberValue((decimal)value);
writer.WriteNumberValue((decimal)value + 0.0m);
}
}
}
@@ -45,7 +45,7 @@ namespace AssetStudio
public override void Write(Utf8JsonWriter writer, PPtr<T> value, JsonSerializerOptions options)
{
JsonSerializer.Serialize(value);
throw new NotImplementedException();
}
}
}
@@ -32,17 +32,17 @@ namespace AssetStudio
var strKey = $"{kv.Key.Key}, {kv.Key.Value}";
jsonDict.Add(strKey, kv.Value);
}
var strValue = JsonSerializer.Serialize(jsonDict, options).Replace(" ", " ");
var strValue = JsonSerializer.SerializeToUtf8Bytes(jsonDict, options);
writer.WriteRawValue(strValue);
}
}
private class GUID
{
[JsonPropertyName("data[0]")] public uint data0;
[JsonPropertyName("data[1]")] public uint data1;
[JsonPropertyName("data[2]")] public uint data2;
[JsonPropertyName("data[3]")] public uint data3;
[JsonPropertyName("data[0]")] public uint data0 { get; set; }
[JsonPropertyName("data[1]")] public uint data1 { get; set; }
[JsonPropertyName("data[2]")] public uint data2 { get; set; }
[JsonPropertyName("data[3]")] public uint data3 { get; set; }
public Guid Convert()
{