diff --git a/.vscode/launch.json b/.vscode/launch.json index f06d3347d..6de27a61e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,16 +1,10 @@ { "version": "0.2.0", "configurations": [ - { - "name": "Unity Editor", - "type": "unity", - "path": "${workspaceFolder}/Library/EditorInstance.json", - "request": "launch" - }, { "name": "Attach to Unity", "type": "vstuc", "request": "attach" } ] -} +} \ No newline at end of file diff --git a/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs b/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs index 2906a996a..2d03c7085 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/UniGLTFPreference.cs @@ -105,27 +105,29 @@ namespace UniGLTF public static bool HasSymbol(string symbol) { - var target = EditorUserBuildSettings.selectedBuildTargetGroup; - var current = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Split(';'); + var buildTarget = UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup( + EditorUserBuildSettings.selectedBuildTargetGroup + ); + PlayerSettings.GetScriptingDefineSymbols(buildTarget, out var current); return current.Contains(symbol); } public static void AddSymbol(string symbol) { - var target = EditorUserBuildSettings.selectedBuildTargetGroup; - var current = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Split(';'); - PlayerSettings.SetScriptingDefineSymbolsForGroup(target, - string.Join(";", current.Concat(new[] { symbol })) + var buildTarget = UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup( + EditorUserBuildSettings.selectedBuildTargetGroup ); + PlayerSettings.GetScriptingDefineSymbols(buildTarget, out var current); + PlayerSettings.SetScriptingDefineSymbols(buildTarget, current.Append(symbol).ToArray()); } public static void RemoveSymbol(string symbol) { - var target = EditorUserBuildSettings.selectedBuildTargetGroup; - var current = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Split(';'); - PlayerSettings.SetScriptingDefineSymbolsForGroup(target, - string.Join(";", current.Where(x => x != symbol)) + var buildTarget = UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup( + EditorUserBuildSettings.selectedBuildTargetGroup ); + PlayerSettings.GetScriptingDefineSymbols(buildTarget, out var current); + PlayerSettings.SetScriptingDefineSymbols(buildTarget, current.Where(x => x != symbol).ToArray()); } public static void ToggleSymbol(string title, string symbol) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs index 50939f4c0..10bfb445f 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs @@ -4,8 +4,8 @@ namespace UniGLTF public static partial class PackageVersion { public const int MAJOR = 0; - public const int MINOR = 121; + public const int MINOR = 122; public const int PATCH = 0; - public const string VERSION = "0.121.0"; + public const string VERSION = "0.122.0"; } } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs index 50886b817..943446b14 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs @@ -4,8 +4,8 @@ namespace UniGLTF public static partial class UniGLTFVersion { public const int MAJOR = 2; - public const int MINOR = 57; + public const int MINOR = 58; public const int PATCH = 0; - public const string VERSION = "2.57.0"; + public const string VERSION = "2.58.0"; } } diff --git a/Assets/UniGLTF/package.json b/Assets/UniGLTF/package.json index 97a4f50db..bedce5f47 100644 --- a/Assets/UniGLTF/package.json +++ b/Assets/UniGLTF/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.gltf", - "version": "0.121.0", + "version": "0.122.0", "displayName": "UniGLTF", "description": "GLTF importer and exporter", "unity": "2021.3", @@ -11,7 +11,7 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.121.0", + "com.vrmc.vrmshaders": "0.122.0", "com.unity.modules.animation": "1.0.0" }, "samples": [ diff --git a/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs b/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs index 15875e7be..e334356ac 100644 --- a/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs +++ b/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs @@ -25,7 +25,11 @@ namespace VRM PreviewSceneManager manager = null; // if we already instantiated a PreviewInstance previously but just lost the reference, then use that same instance instead of making a new one +#if UNITY_2022_3_OR_NEWER + var managers = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); +#else var managers = GameObject.FindObjectsOfType(); +#endif foreach (var x in managers) { if (x.Prefab == prefab) diff --git a/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs b/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs index dda06faa7..21817a5af 100644 --- a/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs +++ b/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs @@ -57,7 +57,11 @@ namespace VRM void Reset() { +#if UNITY_2022_3_OR_NEWER + var cameras = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); +#else var cameras = GameObject.FindObjectsOfType(); +#endif m_firstPersonCamera = Camera.main; m_thirdPersonCameras = cameras.Where(x => x != m_firstPersonCamera).ToArray(); } diff --git a/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs b/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs index c6bb6ccaa..8f4812f76 100644 --- a/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs +++ b/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs @@ -20,8 +20,13 @@ namespace VRM private void Reset() { +#if UNITY_2022_3_OR_NEWER + m_lookAtHead = GameObject.FindFirstObjectByType(); + m_blinker = GameObject.FindFirstObjectByType(); +#else m_lookAtHead = GameObject.FindObjectOfType(); m_blinker = GameObject.FindObjectOfType(); +#endif } float CalcScore(Transform target) diff --git a/Assets/VRM/Samples~/FirstPersonSample/CanvasManager.cs b/Assets/VRM/Samples~/FirstPersonSample/CanvasManager.cs index 6cf18248f..5647b532c 100644 --- a/Assets/VRM/Samples~/FirstPersonSample/CanvasManager.cs +++ b/Assets/VRM/Samples~/FirstPersonSample/CanvasManager.cs @@ -15,8 +15,8 @@ namespace VRM.FirstPersonSample private void Reset() { - LoadVRMButton = GameObject.FindObjectsOfType