mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00
Cleanup
This commit is contained in:
parent
36f23b7cdc
commit
9e7bb1a625
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user