diff --git a/src/DotRecast.Core/DotRecast.Core.csproj b/src/DotRecast.Core/DotRecast.Core.csproj index eff52c8..d727bda 100644 --- a/src/DotRecast.Core/DotRecast.Core.csproj +++ b/src/DotRecast.Core/DotRecast.Core.csproj @@ -4,8 +4,5 @@ netstandard2.1 - - - diff --git a/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj b/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj index 2a71f47..6b37247 100644 --- a/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj +++ b/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj @@ -9,4 +9,8 @@ + + + + diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs index 3ce4207..ce39281 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: using System.IO; using System.IO.Compression; -using System.Text.Json; +using Newtonsoft.Json; namespace DotRecast.Detour.Extras.Unity.Astar { @@ -29,13 +29,13 @@ namespace DotRecast.Detour.Extras.Unity.Astar ZipArchiveEntry entry = file.GetEntry(filename); using StreamReader reader = new StreamReader(entry.Open()); - JsonSerializerOptions options = new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase - }; - + // for unity3d var json = reader.ReadToEnd(); - return JsonSerializer.Deserialize(json, options); + return JsonConvert.DeserializeObject(json); + + // var settings = new JsonSerializerSettings(); + // settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + //return JsonConvert.DeserializeObject(json, settings); } } } \ No newline at end of file diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs index 6ea88ea..686e7b7 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs @@ -19,9 +19,9 @@ freely, subject to the following restrictions: using System; using System.IO; using System.IO.Compression; -using System.Text.Json; -using System.Text.Json.Nodes; + using System.Text.RegularExpressions; +using Newtonsoft.Json; namespace DotRecast.Detour.Extras.Unity.Astar { @@ -41,7 +41,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar var regex = new Regex(pattern); json = regex.Replace(json, replacement); - var meta = JsonSerializer.Deserialize(json); + var meta = JsonConvert.DeserializeObject(json); if (!meta.IsSupportedType()) { throw new ArgumentException("Unsupported graph type " + string.Join(", ", meta.typeNames));