diff --git a/Assets/VRM/UniVRM/Editor/ExporterExtensions.cs b/Assets/VRM/UniVRM/Editor/ExporterExtensions.cs index 6416636bd..86c7445f0 100644 --- a/Assets/VRM/UniVRM/Editor/ExporterExtensions.cs +++ b/Assets/VRM/UniVRM/Editor/ExporterExtensions.cs @@ -1,4 +1,5 @@ using System.Linq; +using MeshUtility; using UnityEngine; namespace VRM @@ -7,7 +8,7 @@ namespace VRM { public static bool EnableForExport(this Component mono) { - if (mono.transform.GetComponentsInParent().Any(x => !x.gameObject.activeSelf)) + if (mono.transform.Ancestors().Any(x => !x.gameObject.activeSelf)) { // 自分か祖先に !activeSelf がいる return false; diff --git a/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs b/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs index b69fcc1b2..509c974db 100644 --- a/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs +++ b/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs @@ -195,7 +195,7 @@ namespace VRM var eraseBones = bones.Select((x, i) => { // 祖先に削除対象が存在するか - bool erase = x.GetComponentsInParent().Any(y => y == eraseRoot); + bool erase = x.Ancestors().Any(y => y == eraseRoot); return new { i,