This commit is contained in:
Sinai 2021-05-26 17:42:14 +10:00
parent 36f23b7cdc
commit 9e7bb1a625

View File

@ -91,12 +91,13 @@ namespace UnityExplorer.UI.ObjectExplorer
if (!string.IsNullOrEmpty(nameFilter) && !obj.name.ContainsIgnoreCase(nameFilter))
continue;
GameObject go = null;
var type = obj.GetActualType();
if (type == typeof(GameObject) || typeof(Component).IsAssignableFrom(type))
{
GameObject go = type == typeof(GameObject)
? obj.TryCast<GameObject>()
: obj.TryCast<Component>()?.gameObject;
if (type == typeof(GameObject))
go = obj.TryCast<GameObject>();
else if (typeof(Component).IsAssignableFrom(type))
go = obj.TryCast<Component>()?.gameObject;
if (go)
{
@ -126,7 +127,6 @@ namespace UnityExplorer.UI.ObjectExplorer
}
}
}
}
results.Add(obj);
}