Skip to content

Commit

Permalink
add unity visionOS compatibility and fix unity utilities JSON parser …
Browse files Browse the repository at this point in the history
…to handle unexpected values
  • Loading branch information
CharleyLanusse authored and sletz committed Oct 12, 2024
1 parent ce365cc commit a7bf5ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions architecture/unity/FaustPolyUtilities_template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
}
Expand Down
9 changes: 6 additions & 3 deletions architecture/unity/FaustUtilities_template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a7bf5ee

Please sign in to comment.