diff --git a/Examples/OpenSeeWebcamInfo.cs b/Examples/OpenSeeWebcamInfo.cs index 4ec5b45..6a4f478 100644 --- a/Examples/OpenSeeWebcamInfo.cs +++ b/Examples/OpenSeeWebcamInfo.cs @@ -8,9 +8,8 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -// To use this, add the following entry to the dependencies in Packages\manifest.json: -// "com.unity.nuget.newtonsoft-json": "2.0.0" -using Newtonsoft.Json; +// UniJSON is part of UniVRM (https://github.com/vrm-c/UniVRM) +using UniJSON; namespace OpenSee { @@ -233,11 +232,15 @@ public class OpenSeeWebcamInfo : MonoBehaviour { if (includeBlackMagic) UnityEngine.Debug.Log("Blackmagic JSON: " + bmJsonData); } - List details = JsonConvert.DeserializeObject>(jsonData); + List details = new List(); + var parsed = JsonParser.Parse(jsonData); + parsed.Deserialize(ref details); foreach (var cam in details) cam.type = OpenSeeWebcamType.DirectShow; if (includeBlackMagic) { - List bmDetails = JsonConvert.DeserializeObject>(bmJsonData); + List bmDetails = new List(); + parsed = JsonParser.Parse(bmJsonData); + parsed.Deserialize(ref bmDetails); foreach (var cam in bmDetails) cam.type = OpenSeeWebcamType.Blackmagic; details.AddRange(bmDetails); @@ -255,5 +258,13 @@ public class OpenSeeWebcamInfo : MonoBehaviour { foreach (var camera in cameras) camera.GetPrettyCapabilities(); } + + public static void AOTCall() { + GenericDeserializer.GenericArrayDeserializer(default(ListTreeNode)); + JsonObjectValidator.GenericDeserializer.DeserializeField(default(JsonSchema), default(ListTreeNode)); + JsonObjectValidator.GenericDeserializer.DeserializeField(default(JsonSchema), default(ListTreeNode)); + GenericDeserializer.GenericArrayDeserializer(default(ListTreeNode)); + throw new InvalidOperationException("This method is used for AOT code generation only. Do not call it at runtime."); + } } } \ No newline at end of file