mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +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))
|
if (!string.IsNullOrEmpty(nameFilter) && !obj.name.ContainsIgnoreCase(nameFilter))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
GameObject go = null;
|
||||||
var type = obj.GetActualType();
|
var type = obj.GetActualType();
|
||||||
if (type == typeof(GameObject) || typeof(Component).IsAssignableFrom(type))
|
|
||||||
{
|
if (type == typeof(GameObject))
|
||||||
GameObject go = type == typeof(GameObject)
|
go = obj.TryCast<GameObject>();
|
||||||
? obj.TryCast<GameObject>()
|
else if (typeof(Component).IsAssignableFrom(type))
|
||||||
: obj.TryCast<Component>()?.gameObject;
|
go = obj.TryCast<Component>()?.gameObject;
|
||||||
|
|
||||||
if (go)
|
if (go)
|
||||||
{
|
{
|
||||||
@ -126,7 +127,6 @@ namespace UnityExplorer.UI.ObjectExplorer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
results.Add(obj);
|
results.Add(obj);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user