From a7bf5ee0964f28a1ab3a577fe0a4d77d7c0e781a Mon Sep 17 00:00:00 2001 From: Charley Lanusse Date: Sat, 12 Oct 2024 10:54:02 -0700 Subject: [PATCH] add unity visionOS compatibility and fix unity utilities JSON parser to handle unexpected values --- architecture/unity/FaustPolyUtilities_template.cs | 9 ++++++--- architecture/unity/FaustUtilities_template.cs | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/architecture/unity/FaustPolyUtilities_template.cs b/architecture/unity/FaustPolyUtilities_template.cs index a42bdec64b..863f40cd37 100644 --- a/architecture/unity/FaustPolyUtilities_template.cs +++ b/architecture/unity/FaustPolyUtilities_template.cs @@ -282,7 +282,7 @@ public class Faust_Context { #if UNITY_EDITOR_OSX || UNITY_EDITOR_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_WSA_10_0 const string _dllName = "PLUGNAME"; - #elif UNITY_IOS + #elif UNITY_IOS || UNITY_VISIONOS const string _dllName = "__Internal"; #elif UNITY_EDITOR || UNITY_ANDROID || UNITY_STANDALONE_LINUX const string _dllName = "PLUGINNAME"; @@ -457,8 +457,11 @@ public static bool fJSONParser(ref string fJSON, out FaustUI faustUI) { success = parseUI(ref fJSON, ref faustUI.ui, ref numitems); break; default: - // Unknown items should be parsed - success = parseDQString(ref fJSON, out value); + // Parse DQString or Num + var fJsonCache = fJSON; + if (success = parseDQString(ref fJSON, out value)) continue; + fJSON = fJsonCache; + success = parseNum(ref fJSON, out value); break; } } diff --git a/architecture/unity/FaustUtilities_template.cs b/architecture/unity/FaustUtilities_template.cs index 832017b51f..d5704518d3 100644 --- a/architecture/unity/FaustUtilities_template.cs +++ b/architecture/unity/FaustUtilities_template.cs @@ -273,7 +273,7 @@ public class Faust_Context { #if UNITY_EDITOR_OSX || UNITY_EDITOR_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_WSA_10_0 const string _dllName = "PLUGNAME"; - #elif UNITY_IOS + #elif UNITY_IOS || UNITY_VISIONOS const string _dllName = "__Internal"; #elif UNITY_EDITOR || UNITY_ANDROID || UNITY_STANDALONE_LINUX const string _dllName = "PLUGINNAME"; @@ -420,8 +420,11 @@ public static bool fJSONParser(ref string fJSON, out FaustUI faustUI) { success = parseUI(ref fJSON, ref faustUI.ui, ref numitems); break; default: - // Unknown items should be parsed - success = parseDQString(ref fJSON, out value); + // Parse DQString or Num + var fJsonCache = fJSON; + if (success = parseDQString(ref fJSON, out value)) continue; + fJSON = fJsonCache; + success = parseNum(ref fJSON, out value); break; } }