親をたどる時、非アクティブなTransformも取得できる方法に修正

This commit is contained in:
faidra 2020-09-10 20:59:58 +09:00
parent 3788d1efcd
commit c634e319a9
2 changed files with 3 additions and 2 deletions

View File

@ -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<Transform>().Any(x => !x.gameObject.activeSelf))
if (mono.transform.Ancestors().Any(x => !x.gameObject.activeSelf))
{
// 自分か祖先に !activeSelf がいる
return false;

View File

@ -195,7 +195,7 @@ namespace VRM
var eraseBones = bones.Select((x, i) =>
{
// 祖先に削除対象が存在するか
bool erase = x.GetComponentsInParent<Transform>().Any(y => y == eraseRoot);
bool erase = x.Ancestors().Any(y => y == eraseRoot);
return new
{
i,