public static void FindComponentReferences(MenuCommand command) { HierarchyScopeReferencesFinder.FindComponentReferencesInHierarchy(command.context as Component); }
public void DrawFooter() { using (new GUILayout.HorizontalScope()) { GUILayout.Space(10); if (SearchResultsStorage.HierarchyReferencesLastSearched.Length == 0) { GUI.enabled = false; } if (UIHelpers.ImageButton("Refresh", "Restarts references search for the previous results.", CSIcons.Repeat)) { if (Event.current.control && Event.current.shift) { ReferencesFinder.debugMode = true; Event.current.Use(); } else { ReferencesFinder.debugMode = false; } EditorApplication.delayCall += () => { var sceneObjects = CSObjectTools.GetObjectsFromInstanceIds(SearchResultsStorage.HierarchyReferencesLastSearched); HierarchyScopeReferencesFinder.FindHierarchyObjectsReferences(sceneObjects, null); }; } GUI.enabled = true; if (SearchResultsStorage.HierarchyReferencesSearchResults.Length == 0) { GUI.enabled = false; } if (UIHelpers.ImageButton("Collapse all", "Collapses all tree items.", CSIcons.Collapse)) { treePanel.CollapseAll(); } if (UIHelpers.ImageButton("Expand all", "Expands all tree items.", CSIcons.Expand)) { treePanel.ExpandAll(); } if (UIHelpers.ImageButton("Clear results", "Clears results tree and empties cache.", CSIcons.Clear)) { ClearResults(); } GUI.enabled = true; GUILayout.Space(10); } GUILayout.Space(10); }