mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-05-25 13:08:24 -04:00
Use system.text.json to parse typetree
well, it's still slower than some more suitable libs for such task, but stable and with minimal code changes (and has net472 support, yeah)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
@@ -1018,9 +1018,9 @@ namespace AssetStudio
|
||||
|
||||
public AnimationClip() { }
|
||||
|
||||
public AnimationClip(ObjectReader reader, IDictionary typeDict) : base(reader)
|
||||
public AnimationClip(ObjectReader reader, IDictionary typeDict, JsonSerializerOptions jsonOptions) : base(reader)
|
||||
{
|
||||
var parsedAnimClip = JsonConvert.DeserializeObject<AnimationClip>(JsonConvert.SerializeObject(typeDict));
|
||||
var parsedAnimClip = JsonSerializer.Deserialize<AnimationClip>(JsonSerializer.SerializeToUtf8Bytes(typeDict, jsonOptions), jsonOptions);
|
||||
m_AnimationType = parsedAnimClip.m_AnimationType;
|
||||
m_Legacy = parsedAnimClip.m_Legacy;
|
||||
m_Compressed = parsedAnimClip.m_Compressed;
|
||||
|
||||
Reference in New Issue
Block a user