mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Replace Newtonsoft.Json with System.Text.Json for MonoBehaviour assets
This commit is contained in:
@@ -60,7 +60,6 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft-WindowsAPICodePack-Core-6.0" Version="1.1.7" />
|
||||
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell-6.0" Version="1.1.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' != 'net472' ">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using AssetStudio;
|
||||
using Newtonsoft.Json;
|
||||
using OpenTK.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -1259,7 +1258,7 @@ namespace AssetStudioGUI
|
||||
var type = MonoBehaviourToTypeTree(m_MonoBehaviour);
|
||||
obj = m_MonoBehaviour.ToType(type);
|
||||
}
|
||||
var str = JsonConvert.SerializeObject(obj, Formatting.Indented);
|
||||
var str = System.Text.Json.JsonSerializer.Serialize(obj, AssetStudio.Object.JsonOptions);
|
||||
PreviewText(str);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using AssetStudio;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -121,7 +120,7 @@ namespace AssetStudioGUI
|
||||
var m_Type = Studio.MonoBehaviourToTypeTree(m_MonoBehaviour);
|
||||
type = m_MonoBehaviour.ToType(m_Type);
|
||||
}
|
||||
var str = JsonConvert.SerializeObject(type, Formatting.Indented);
|
||||
var str = System.Text.Json.JsonSerializer.Serialize(type, Object.JsonOptions);
|
||||
File.WriteAllText(exportFullPath, str);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user