Parent() private method

private Parent ( ) : bool
return bool
Example #1
0
        private float DoSearchResultPathGUI()
        {
            if (!base.hasSearchFilter)
            {
                return(0f);
            }
            GUILayout.FlexibleSpace();
            Rect rect = EditorGUILayout.BeginVertical(EditorStyles.inspectorBig, new GUILayoutOption[0]);

            GUILayout.Label("Path:", new GUILayoutOption[0]);
            if (this.m_TreeView.HasSelection())
            {
                int instanceID = this.m_TreeView.GetSelection()[0];
                IHierarchyProperty property = new HierarchyProperty(HierarchyType.GameObjects);
                property.Find(instanceID, null);
                if (property.isValid)
                {
                    do
                    {
                        EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                        GUILayout.Label(property.icon, new GUILayoutOption[0]);
                        GUILayout.Label(property.name, new GUILayoutOption[0]);
                        GUILayout.FlexibleSpace();
                        EditorGUILayout.EndHorizontal();
                    }while (property.Parent());
                }
            }
            EditorGUILayout.EndVertical();
            GUILayout.Space(0f);
            return(rect.height);
        }
Example #2
0
        private bool FrameObject(UnityEngine.Object target)
        {
            bool result;

            if (target == null)
            {
                result = false;
            }
            else
            {
                HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
                if (hierarchyProperty.Find(target.GetInstanceID(), null))
                {
                    while (hierarchyProperty.Parent())
                    {
                        this.SetExpanded(hierarchyProperty.instanceID, true);
                    }
                }
                hierarchyProperty.Reset();
                if (hierarchyProperty.Find(target.GetInstanceID(), this.m_ExpandedArray))
                {
                    this.ScrollTo(ASHistoryFileView.m_RowHeight * (float)hierarchyProperty.row + this.m_SpaceAtTheTop);
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Example #3
0
        protected override HashSet <int> GetParentsAbove(int id)
        {
            HashSet <int>      set      = new HashSet <int>();
            IHierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);

            if (property.Find(id, null))
            {
                while (property.Parent())
                {
                    set.Add(property.instanceID);
                }
            }
            return(set);
        }
        protected override HashSet <int> GetParentsAbove(int id)
        {
            HashSet <int>      hashSet           = new HashSet <int>();
            IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects);

            if (hierarchyProperty.Find(id, null))
            {
                while (hierarchyProperty.Parent())
                {
                    hashSet.Add(hierarchyProperty.instanceID);
                }
            }
            return(hashSet);
        }
        protected override HashSet <int> GetParentsAbove(int id)
        {
            HashSet <int> set = new HashSet <int>();

            if (this.IsValidHierarchyInstanceID(id))
            {
                IHierarchyProperty property = new HierarchyProperty(HierarchyType.GameObjects);
                if (property.Find(id, null))
                {
                    while (property.Parent())
                    {
                        set.Add(property.instanceID);
                    }
                }
            }
            return(set);
        }
Example #6
0
        protected override HashSet <int> GetParentsAbove(int id)
        {
            HashSet <int> parents = new HashSet <int>();

            if (!IsValidHierarchyInstanceID(id))
            {
                return(parents);
            }

            IHierarchyProperty propertyIterator = new HierarchyProperty(k_HierarchyType);

            if (propertyIterator.Find(id, null))
            {
                while (propertyIterator.Parent())
                {
                    parents.Add((propertyIterator.instanceID));
                }
            }
            return(parents);
        }
Example #7
0
 private bool FrameObject(UnityEngine.Object target)
 {
     if (target != null)
     {
         HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
         if (property.Find(target.GetInstanceID(), null))
         {
             while (property.Parent())
             {
                 this.SetExpanded(property.instanceID, true);
             }
         }
         property.Reset();
         if (property.Find(target.GetInstanceID(), this.m_ExpandedArray))
         {
             this.ScrollTo((m_RowHeight * property.row) + this.m_SpaceAtTheTop);
             return(true);
         }
     }
     return(false);
 }
        protected override HashSet <int> GetParentsAbove(int id)
        {
            HashSet <int> hashSet = new HashSet <int>();
            HashSet <int> result;

            if (!this.IsValidHierarchyInstanceID(id))
            {
                result = hashSet;
            }
            else
            {
                IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects);
                if (hierarchyProperty.Find(id, null))
                {
                    while (hierarchyProperty.Parent())
                    {
                        hashSet.Add(hierarchyProperty.instanceID);
                    }
                }
                result = hashSet;
            }
            return(result);
        }
		private bool FrameObject(UnityEngine.Object target)
		{
			if (target == null)
			{
				return false;
			}
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			if (hierarchyProperty.Find(target.GetInstanceID(), null))
			{
				while (hierarchyProperty.Parent())
				{
					this.SetExpanded(hierarchyProperty.instanceID, true);
				}
			}
			hierarchyProperty.Reset();
			if (hierarchyProperty.Find(target.GetInstanceID(), this.m_ExpandedArray))
			{
				this.ScrollTo(ASHistoryFileView.m_RowHeight * (float)hierarchyProperty.row + this.m_SpaceAtTheTop);
				return true;
			}
			return false;
		}
Example #10
0
 private bool FrameObject(UnityEngine.Object target)
 {
     if (target != null)
     {
         HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
         if (property.Find(target.GetInstanceID(), null))
         {
             while (property.Parent())
             {
                 this.SetExpanded(property.instanceID, true);
             }
         }
         property.Reset();
         if (property.Find(target.GetInstanceID(), this.m_ExpandedArray))
         {
             this.ScrollTo((m_RowHeight * property.row) + this.m_SpaceAtTheTop);
             return true;
         }
     }
     return false;
 }
		protected override HashSet<int> GetParentsAbove(int id)
		{
			HashSet<int> hashSet = new HashSet<int>();
			IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects);
			if (hierarchyProperty.Find(id, null))
			{
				while (hierarchyProperty.Parent())
				{
					hashSet.Add(hierarchyProperty.instanceID);
				}
			}
			return hashSet;
		}
		private float DoSearchResultPathGUI()
		{
			if (!base.hasSearchFilter)
			{
				return 0f;
			}
			GUILayout.FlexibleSpace();
			Rect rect = EditorGUILayout.BeginVertical(EditorStyles.inspectorBig, new GUILayoutOption[0]);
			GUILayout.Label("Path:", new GUILayoutOption[0]);
			if (this.m_TreeView.HasSelection())
			{
				int instanceID = this.m_TreeView.GetSelection()[0];
				IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects);
				hierarchyProperty.Find(instanceID, null);
				if (hierarchyProperty.isValid)
				{
					do
					{
						EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
						GUILayout.Label(hierarchyProperty.icon, new GUILayoutOption[0]);
						GUILayout.Label(hierarchyProperty.name, new GUILayoutOption[0]);
						GUILayout.FlexibleSpace();
						EditorGUILayout.EndHorizontal();
					}
					while (hierarchyProperty.Parent());
				}
			}
			EditorGUILayout.EndVertical();
			GUILayout.Space(0f);
			return rect.height;
		}
		private void Reveal(int instanceID)
		{
			IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			if (hierarchyProperty.Find(instanceID, null) && hierarchyProperty.Parent() && !hierarchyProperty.isFolder)
			{
				int instanceID2 = hierarchyProperty.instanceID;
				this.m_LocalAssets.ChangeExpandedState(instanceID2, true);
			}
		}
		private void FrameObjectPrivate(int instanceID, bool frame, bool ping)
		{
			if (instanceID == 0 || this.m_ListArea == null)
			{
				return;
			}
			if (this.m_LastFramedID != instanceID)
			{
				this.EndPing();
			}
			this.m_LastFramedID = instanceID;
			this.ClearSearch();
			if (this.m_ViewMode == ProjectBrowser.ViewMode.TwoColumns)
			{
				int num = 0;
				IHierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
				if (hierarchyProperty.Find(instanceID, null))
				{
					while (hierarchyProperty.Parent())
					{
						if (hierarchyProperty.isFolder)
						{
							num = hierarchyProperty.instanceID;
							break;
						}
					}
					if (num == 0)
					{
						num = ProjectBrowserColumnOneTreeViewDataSource.GetAssetsFolderInstanceID();
					}
				}
				if (num != 0)
				{
					this.m_FolderTree.Frame(num, frame, ping);
					if (frame)
					{
						this.ShowFolderContents(num, true);
					}
					this.m_ListArea.Frame(instanceID, frame, ping);
				}
			}
			else
			{
				if (this.m_ViewMode == ProjectBrowser.ViewMode.OneColumn)
				{
					this.m_AssetTree.Frame(instanceID, frame, ping);
				}
			}
		}
		private void SetSearchFoldersFromCurrentSelection()
		{
			HashSet<string> hashSet = new HashSet<string>();
			int[] instanceIDs = Selection.instanceIDs;
			for (int i = 0; i < instanceIDs.Length; i++)
			{
				int instanceID = instanceIDs[i];
				HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
				if (hierarchyProperty.Find(instanceID, null))
				{
					int num = 0;
					while (hierarchyProperty.isValid && !hierarchyProperty.isFolder && num++ < 3)
					{
						hierarchyProperty.Parent();
					}
					if (hierarchyProperty.isValid && hierarchyProperty.isFolder)
					{
						hashSet.Add(AssetDatabase.GetAssetPath(hierarchyProperty.instanceID));
					}
				}
			}
			this.m_SearchFilter.folders = ProjectWindowUtil.GetBaseFolders(hashSet.ToArray<string>());
		}
		private int GetParentFolderInstanceID(int instanceID)
		{
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			if (hierarchyProperty.Find(instanceID, null))
			{
				while (hierarchyProperty.Parent())
				{
					if (hierarchyProperty.isFolder)
					{
						return hierarchyProperty.instanceID;
					}
				}
			}
			return ProjectBrowserColumnOneTreeViewDataSource.GetAssetsFolderInstanceID();
		}