public static void SearchForType(System.Type type) { UnityEngine.Object[] objArray = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(SceneHierarchyWindow)); SceneHierarchyWindow window = (objArray.Length <= 0) ? null : (objArray[0] as SceneHierarchyWindow); if (window != null) { s_HierarchyWindow = window; if ((type == null) || (type == typeof(GameObject))) { s_FocusType = null; window.ClearSearchFilter(); } else { s_FocusType = type; if (window.searchMode == SearchableEditorWindow.SearchMode.Name) { window.searchMode = SearchableEditorWindow.SearchMode.All; } window.SetSearchFilter("t:" + type.Name, window.searchMode, false); window.hasSearchFilterFocus = true; } } else { s_FocusType = null; } }
public static void SearchForType(Type type) { UnityEngine.Object[] array = Resources.FindObjectsOfTypeAll(typeof(SceneHierarchyWindow)); SceneHierarchyWindow sceneHierarchyWindow = (array.Length <= 0) ? null : (array[0] as SceneHierarchyWindow); if (sceneHierarchyWindow) { SceneModeUtility.s_HierarchyWindow = sceneHierarchyWindow; if (type == null || type == typeof(GameObject)) { SceneModeUtility.s_FocusType = null; sceneHierarchyWindow.ClearSearchFilter(); } else { SceneModeUtility.s_FocusType = type; if (sceneHierarchyWindow.searchMode == SearchableEditorWindow.SearchMode.Name) { sceneHierarchyWindow.searchMode = SearchableEditorWindow.SearchMode.All; } sceneHierarchyWindow.SetSearchFilter("t:" + type.Name, sceneHierarchyWindow.searchMode, false); sceneHierarchyWindow.hasSearchFilterFocus = true; } } else { SceneModeUtility.s_FocusType = null; } }
public static void SearchForType(Type type) { Object[] wins = Resources.FindObjectsOfTypeAll(typeof(SceneHierarchyWindow)); SceneHierarchyWindow win = wins.Length > 0 ? (wins[0] as SceneHierarchyWindow) : null; if (win) { s_HierarchyWindow = win; if (type == null || type == typeof(GameObject)) { s_FocusType = null; win.ClearSearchFilter(); } else { s_FocusType = type; if (win.searchMode == SearchableEditorWindow.SearchMode.Name) { win.searchMode = SearchableEditorWindow.SearchMode.All; } win.SetSearchFilter("t:" + type.Name, win.searchMode, false); win.hasSearchFilterFocus = true; } } else { s_FocusType = null; } }