private float DoSearchResultPathGUI() { if (!this.hasSearchFilter) { return(0.0f); } GUILayout.FlexibleSpace(); Rect rect = EditorGUILayout.BeginVertical(EditorStyles.inspectorBig, new GUILayoutOption[0]); GUILayout.Label("Path:"); if (this.m_TreeView.HasSelection()) { int instanceID = this.m_TreeView.GetSelection()[0]; IHierarchyProperty hierarchyProperty = (IHierarchyProperty) new HierarchyProperty(HierarchyType.GameObjects); hierarchyProperty.Find(instanceID, (int[])null); if (hierarchyProperty.isValid) { do { EditorGUILayout.BeginHorizontal(); GUILayout.Label((Texture)hierarchyProperty.icon); GUILayout.Label(hierarchyProperty.name); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }while (hierarchyProperty.Parent()); } } EditorGUILayout.EndVertical(); GUILayout.Space(0.0f); return(rect.height); }
public override void FetchData() { this.m_RootItem = new TreeViewItem(this.m_RootInstanceID, 0, (TreeViewItem) null, AssetsTreeViewDataSource.CreateDisplayName(this.m_RootInstanceID)); if (!this.showRootNode) this.SetExpanded(this.m_RootItem, true); IHierarchyProperty hierarchyProperty = (IHierarchyProperty) new HierarchyProperty(HierarchyType.Assets); hierarchyProperty.Reset(); if (!hierarchyProperty.Find(this.m_RootInstanceID, (int[]) null)) Debug.LogError((object) ("Root Asset with id " + (object) this.m_RootInstanceID + " not found!!")); int minDepth = hierarchyProperty.depth + (!this.showRootNode ? 1 : 0); int[] array = this.expandedIDs.ToArray(); Texture2D texture = EditorGUIUtility.FindTexture(EditorResourcesUtility.emptyFolderIconName); this.m_VisibleRows = new List<TreeViewItem>(); while (hierarchyProperty.NextWithDepthCheck(array, minDepth)) { if (!this.foldersOnly || hierarchyProperty.isFolder) { int depth = hierarchyProperty.depth - minDepth; TreeViewItem treeViewItem = !hierarchyProperty.isFolder ? (TreeViewItem) new AssetsTreeViewDataSource.NonFolderTreeItem(hierarchyProperty.instanceID, depth, (TreeViewItem) null, hierarchyProperty.name) : (TreeViewItem) new AssetsTreeViewDataSource.FolderTreeItem(hierarchyProperty.instanceID, depth, (TreeViewItem) null, hierarchyProperty.name); treeViewItem.icon = !hierarchyProperty.isFolder || hierarchyProperty.hasChildren ? hierarchyProperty.icon : texture; if (hierarchyProperty.hasChildren) treeViewItem.AddChild((TreeViewItem) null); this.m_VisibleRows.Add(treeViewItem); } } TreeViewUtility.SetChildParentReferences(this.m_VisibleRows, this.m_RootItem); if (this.foldersFirst) { AssetsTreeViewDataSource.FoldersFirstRecursive(this.m_RootItem); this.m_VisibleRows.Clear(); this.GetVisibleItemsRecursive(this.m_RootItem, this.m_VisibleRows); } this.m_NeedRefreshVisibleFolders = false; this.m_TreeView.SetSelection(Selection.instanceIDs, false); }
// Should return the items that have children from id and below protected override HashSet <int> GetParentsBelow(int id) { // Add all children expanded ids to hashset HashSet <int> parentsBelow = new HashSet <int>(); if (!IsValidHierarchyInstanceID(id)) { return(parentsBelow); } IHierarchyProperty search = CreateHierarchyProperty(); if (search.Find(id, null)) { parentsBelow.Add(id); int depth = search.depth; while (search.Next(null) && search.depth > depth) { if (search.hasChildren) { parentsBelow.Add(search.instanceID); } } } return(parentsBelow); }
protected override HashSet<int> GetParentsBelow(int id) { HashSet<int> intSet = new HashSet<int>(); IHierarchyProperty hierarchyProperty = (IHierarchyProperty) new HierarchyProperty(HierarchyType.Assets); if (hierarchyProperty.Find(id, (int[]) null)) { intSet.Add(id); int depth = hierarchyProperty.depth; while (hierarchyProperty.Next((int[]) null) && hierarchyProperty.depth > depth) { if (hierarchyProperty.hasChildren) intSet.Add(hierarchyProperty.instanceID); } } return intSet; }
protected override void GetParentsAbove(int id, HashSet <int> parentsAbove) { if (!IsValidHierarchyInstanceID(id)) { return; } IHierarchyProperty propertyIterator = CreateHierarchyProperty(); if (propertyIterator.Find(id, null)) { while (propertyIterator.Parent()) { parentsAbove.Add((propertyIterator.instanceID)); } } }
protected override HashSet <int> GetParentsAbove(int id) { HashSet <int> intSet = new HashSet <int>(); if (!this.IsValidHierarchyInstanceID(id)) { return(intSet); } IHierarchyProperty hierarchyProperty = (IHierarchyProperty) new HierarchyProperty(HierarchyType.GameObjects); if (hierarchyProperty.Find(id, (int[])null)) { while (hierarchyProperty.Parent()) { intSet.Add(hierarchyProperty.instanceID); } } return(intSet); }
protected override HashSet <int> GetParentsAbove(int id) { HashSet <int> parents = new HashSet <int>(); if (!IsValidHierarchyInstanceID(id)) { return(parents); } IHierarchyProperty propertyIterator = CreateHierarchyProperty(); if (propertyIterator.Find(id, null)) { while (propertyIterator.Parent()) { parents.Add((propertyIterator.instanceID)); } } return(parents); }
protected override HashSet <int> GetParentsBelow(int id) { HashSet <int> intSet = new HashSet <int>(); if (!this.IsValidHierarchyInstanceID(id)) { return(intSet); } IHierarchyProperty hierarchyProperty = (IHierarchyProperty) new HierarchyProperty(HierarchyType.GameObjects); if (hierarchyProperty.Find(id, (int[])null)) { intSet.Add(id); int depth = hierarchyProperty.depth; while (hierarchyProperty.Next((int[])null) && hierarchyProperty.depth > depth) { if (hierarchyProperty.hasChildren) { intSet.Add(hierarchyProperty.instanceID); } } } return(intSet); }