diff --git a/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs b/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs index 15875e7be..843ff1291 100644 --- a/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs +++ b/Assets/VRM/Runtime/BlendShape/PreviewSceneManager.cs @@ -25,7 +25,7 @@ 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 - var managers = GameObject.FindObjectsOfType(); + var managers = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); 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..8126111ef 100644 --- a/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs +++ b/Assets/VRM/Runtime/FirstPerson/VRMFirstPersonCameraManager.cs @@ -57,7 +57,7 @@ namespace VRM void Reset() { - var cameras = GameObject.FindObjectsOfType(); + var cameras = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); 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..f7c99ec3e 100644 --- a/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs +++ b/Assets/VRM/Runtime/LookAt/LookAtTargetSwitcher.cs @@ -20,8 +20,8 @@ namespace VRM private void Reset() { - m_lookAtHead = GameObject.FindObjectOfType(); - m_blinker = GameObject.FindObjectOfType(); + m_lookAtHead = GameObject.FindFirstObjectByType(); + m_blinker = GameObject.FindFirstObjectByType(); } float CalcScore(Transform target) diff --git a/Assets/VRM10/Runtime/Components/Expression/Preview/PreviewSceneManager.cs b/Assets/VRM10/Runtime/Components/Expression/Preview/PreviewSceneManager.cs index 51d83ba51..3a9c8d836 100644 --- a/Assets/VRM10/Runtime/Components/Expression/Preview/PreviewSceneManager.cs +++ b/Assets/VRM10/Runtime/Components/Expression/Preview/PreviewSceneManager.cs @@ -27,7 +27,7 @@ namespace UniVRM10 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 - var managers = GameObject.FindObjectsOfType(); + var managers = GameObject.FindObjectsByType(FindObjectsSortMode.InstanceID); foreach (var x in managers) { if (x.Prefab == prefab) diff --git a/Assets/VRM10/Runtime/FastSpringBone/System/FastSpringBoneService.cs b/Assets/VRM10/Runtime/FastSpringBone/System/FastSpringBoneService.cs index d33caa111..da1e52f28 100644 --- a/Assets/VRM10/Runtime/FastSpringBone/System/FastSpringBoneService.cs +++ b/Assets/VRM10/Runtime/FastSpringBone/System/FastSpringBoneService.cs @@ -49,7 +49,7 @@ namespace UniVRM10.FastSpringBones.System { if (_instance) return _instance; - _instance = FindObjectOfType(); + _instance = FindFirstObjectByType(); if (_instance) return _instance; var gameObject = new GameObject("FastSpringBone Service"); diff --git a/Assets/VRM10_Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs b/Assets/VRM10_Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs index 9cded7de8..6e01fd11e 100644 --- a/Assets/VRM10_Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs +++ b/Assets/VRM10_Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs @@ -15,8 +15,8 @@ namespace UniVRM10.FirstPersonSample private void Reset() { - LoadVRMButton = GameObject.FindObjectsOfType