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,39 +91,39 @@ 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))
|
||||||
|
go = obj.TryCast<GameObject>();
|
||||||
|
else if (typeof(Component).IsAssignableFrom(type))
|
||||||
|
go = obj.TryCast<Component>()?.gameObject;
|
||||||
|
|
||||||
|
if (go)
|
||||||
{
|
{
|
||||||
GameObject go = type == typeof(GameObject)
|
// hide unityexplorer objects
|
||||||
? obj.TryCast<GameObject>()
|
if (go.transform.root.name == "ExplorerCanvas")
|
||||||
: obj.TryCast<Component>()?.gameObject;
|
continue;
|
||||||
|
|
||||||
if (go)
|
if (shouldFilterGOs)
|
||||||
{
|
{
|
||||||
// hide unityexplorer objects
|
// scene check
|
||||||
if (go.transform.root.name == "ExplorerCanvas")
|
if (sceneFilter != SceneFilter.Any)
|
||||||
continue;
|
|
||||||
|
|
||||||
if (shouldFilterGOs)
|
|
||||||
{
|
{
|
||||||
// scene check
|
if (!Filter(go.scene, sceneFilter))
|
||||||
if (sceneFilter != SceneFilter.Any)
|
continue;
|
||||||
{
|
}
|
||||||
if (!Filter(go.scene, sceneFilter))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (childFilter != ChildFilter.Any)
|
if (childFilter != ChildFilter.Any)
|
||||||
{
|
{
|
||||||
if (!go)
|
if (!go)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// root object check (no parent)
|
// root object check (no parent)
|
||||||
if (childFilter == ChildFilter.HasParent && !go.transform.parent)
|
if (childFilter == ChildFilter.HasParent && !go.transform.parent)
|
||||||
continue;
|
continue;
|
||||||
else if (childFilter == ChildFilter.RootObject && go.transform.parent)
|
else if (childFilter == ChildFilter.RootObject && go.transform.parent)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user