Esempio n. 1
0
 private void CopyPropertyData(ref FilteredHierarchy.FilterResult result, HierarchyProperty property)
 {
     if (result == null)
     {
         result = new FilteredHierarchy.FilterResult();
     }
     result.instanceID           = property.instanceID;
     result.name                 = property.name;
     result.hasChildren          = property.hasChildren;
     result.colorCode            = property.colorCode;
     result.isMainRepresentation = property.isMainRepresentation;
     result.hasFullPreviewImage  = property.hasFullPreviewImage;
     result.iconDrawStyle        = property.iconDrawStyle;
     result.isFolder             = property.isFolder;
     result.type                 = this.hierarchyType;
     if (!property.isMainRepresentation)
     {
         result.icon = property.icon;
     }
     else if (property.isFolder && !property.hasChildren)
     {
         result.icon = EditorGUIUtility.FindTexture(EditorResourcesUtility.emptyFolderIconName);
     }
     else
     {
         result.icon = (Texture2D)null;
     }
 }
Esempio n. 2
0
        private void FolderBrowsing(HierarchyProperty property)
        {
            List <FilteredHierarchy.FilterResult> filterResultList = new List <FilteredHierarchy.FilterResult>();

            foreach (string folder in this.m_SearchFilter.folders)
            {
                int mainAssetInstanceId = AssetDatabase.GetMainAssetInstanceID(folder);
                if (property.Find(mainAssetInstanceId, (int[])null))
                {
                    int   depth = property.depth;
                    int[] array = new int[1] {
                        mainAssetInstanceId
                    };
                    while (property.Next(array) && property.depth > depth)
                    {
                        FilteredHierarchy.FilterResult result = new FilteredHierarchy.FilterResult();
                        this.CopyPropertyData(ref result, property);
                        filterResultList.Add(result);
                        if (property.hasChildren && !property.isFolder)
                        {
                            Array.Resize <int>(ref array, array.Length + 1);
                            array[array.Length - 1] = property.instanceID;
                        }
                    }
                }
            }
            this.m_Results = filterResultList.ToArray();
        }
Esempio n. 3
0
        private void FolderBrowsing(HierarchyProperty property)
        {
            List <FilteredHierarchy.FilterResult> list = new List <FilteredHierarchy.FilterResult>();

            string[] folders = this.m_SearchFilter.folders;
            for (int i = 0; i < folders.Length; i++)
            {
                string assetPath = folders[i];
                int    mainAssetOrInProgressProxyInstanceID = AssetDatabase.GetMainAssetOrInProgressProxyInstanceID(assetPath);
                if (property.Find(mainAssetOrInProgressProxyInstanceID, null))
                {
                    int   depth = property.depth;
                    int[] array = new int[]
                    {
                        mainAssetOrInProgressProxyInstanceID
                    };
                    while (property.Next(array))
                    {
                        if (property.depth <= depth)
                        {
                            break;
                        }
                        FilteredHierarchy.FilterResult item = new FilteredHierarchy.FilterResult();
                        this.CopyPropertyData(ref item, property);
                        list.Add(item);
                        if (property.hasChildren && !property.isFolder)
                        {
                            Array.Resize <int>(ref array, array.Length + 1);
                            array[array.Length - 1] = property.instanceID;
                        }
                    }
                }
            }
            this.m_Results = list.ToArray();
        }
Esempio n. 4
0
        private void SearchInFolders(HierarchyProperty property)
        {
            List <FilteredHierarchy.FilterResult> list = new List <FilteredHierarchy.FilterResult>();

            string[] baseFolders = ProjectWindowUtil.GetBaseFolders(this.m_SearchFilter.folders);
            string[] array       = baseFolders;
            for (int i = 0; i < array.Length; i++)
            {
                string assetPath = array[i];
                property.SetSearchFilter(new SearchFilter());
                int mainAssetInstanceID = AssetDatabase.GetMainAssetInstanceID(assetPath);
                if (property.Find(mainAssetInstanceID, null))
                {
                    property.SetSearchFilter(this.m_SearchFilter);
                    int   depth    = property.depth;
                    int[] expanded = null;
                    while (property.NextWithDepthCheck(expanded, depth + 1))
                    {
                        FilteredHierarchy.FilterResult item = new FilteredHierarchy.FilterResult();
                        this.CopyPropertyData(ref item, property);
                        list.Add(item);
                    }
                }
            }
            this.m_Results = list.ToArray();
        }
Esempio n. 5
0
 public void ResultsChanged()
 {
     this.m_Results = new FilteredHierarchy.FilterResult[0];
     if (this.m_SearchFilter.GetState() != SearchFilter.State.EmptySearchFilter)
     {
         HierarchyProperty property = new HierarchyProperty(this.m_HierarchyType);
         property.SetSearchFilter(this.m_SearchFilter);
         this.AddResults(property);
         if (this.m_SearchFilter.IsSearching())
         {
             Array.Sort <FilteredHierarchy.FilterResult>(this.m_Results, (Comparison <FilteredHierarchy.FilterResult>)((result1, result2) => EditorUtility.NaturalCompare(result1.name, result2.name)));
         }
         if (!this.foldersFirst)
         {
             return;
         }
         for (int sourceIndex = 0; sourceIndex < this.m_Results.Length; ++sourceIndex)
         {
             if (!this.m_Results[sourceIndex].isFolder)
             {
                 for (int index = sourceIndex + 1; index < this.m_Results.Length; ++index)
                 {
                     if (this.m_Results[index].isFolder)
                     {
                         FilteredHierarchy.FilterResult result = this.m_Results[index];
                         int length = index - sourceIndex;
                         Array.Copy((Array)this.m_Results, sourceIndex, (Array)this.m_Results, sourceIndex + 1, length);
                         this.m_Results[sourceIndex] = result;
                         break;
                     }
                 }
             }
         }
     }
     else
     {
         if (this.m_HierarchyType != HierarchyType.GameObjects)
         {
             return;
         }
         new HierarchyProperty(HierarchyType.GameObjects).SetSearchFilter(this.m_SearchFilter);
     }
 }
Esempio n. 6
0
 public void ResultsChanged()
 {
     this.m_Results = new FilteredHierarchy.FilterResult[0];
     if (this.m_SearchFilter.GetState() != SearchFilter.State.EmptySearchFilter)
     {
         HierarchyProperty hierarchyProperty = new HierarchyProperty(this.m_HierarchyType);
         hierarchyProperty.SetSearchFilter(this.m_SearchFilter);
         this.AddResults(hierarchyProperty);
         if (this.m_SearchFilter.IsSearching())
         {
             Array.Sort <FilteredHierarchy.FilterResult>(this.m_Results, (FilteredHierarchy.FilterResult result1, FilteredHierarchy.FilterResult result2) => EditorUtility.NaturalCompare(result1.name, result2.name));
         }
         if (this.foldersFirst)
         {
             for (int i = 0; i < this.m_Results.Length; i++)
             {
                 if (!this.m_Results[i].isFolder)
                 {
                     for (int j = i + 1; j < this.m_Results.Length; j++)
                     {
                         if (this.m_Results[j].isFolder)
                         {
                             FilteredHierarchy.FilterResult filterResult = this.m_Results[j];
                             int length = j - i;
                             Array.Copy(this.m_Results, i, this.m_Results, i + 1, length);
                             this.m_Results[i] = filterResult;
                             break;
                         }
                     }
                 }
             }
         }
     }
     else
     {
         if (this.m_HierarchyType == HierarchyType.GameObjects)
         {
             HierarchyProperty hierarchyProperty2 = new HierarchyProperty(HierarchyType.GameObjects);
             hierarchyProperty2.SetSearchFilter(this.m_SearchFilter);
         }
     }
 }
 private void CopyPropertyData(ref FilteredHierarchy.FilterResult result, HierarchyProperty property)
 {
   if (result == null)
     result = new FilteredHierarchy.FilterResult();
   result.instanceID = property.instanceID;
   result.name = property.name;
   result.hasChildren = property.hasChildren;
   result.colorCode = property.colorCode;
   result.isMainRepresentation = property.isMainRepresentation;
   result.hasFullPreviewImage = property.hasFullPreviewImage;
   result.iconDrawStyle = property.iconDrawStyle;
   result.isFolder = property.isFolder;
   result.type = this.hierarchyType;
   if (!property.isMainRepresentation)
     result.icon = property.icon;
   else if (property.isFolder && !property.hasChildren)
     result.icon = EditorGUIUtility.FindTexture(EditorResourcesUtility.emptyFolderIconName);
   else
     result.icon = (Texture2D) null;
 }
Esempio n. 8
0
        private void SearchInFolders(HierarchyProperty property)
        {
            List <FilteredHierarchy.FilterResult> filterResultList = new List <FilteredHierarchy.FilterResult>();

            foreach (string baseFolder in ProjectWindowUtil.GetBaseFolders(this.m_SearchFilter.folders))
            {
                property.SetSearchFilter(new SearchFilter());
                int mainAssetInstanceId = AssetDatabase.GetMainAssetInstanceID(baseFolder);
                if (property.Find(mainAssetInstanceId, (int[])null))
                {
                    property.SetSearchFilter(this.m_SearchFilter);
                    int   depth    = property.depth;
                    int[] expanded = (int[])null;
                    while (property.NextWithDepthCheck(expanded, depth + 1))
                    {
                        FilteredHierarchy.FilterResult result = new FilteredHierarchy.FilterResult();
                        this.CopyPropertyData(ref result, property);
                        filterResultList.Add(result);
                    }
                }
            }
            this.m_Results = filterResultList.ToArray();
        }
		private void FolderBrowsing(HierarchyProperty property)
		{
			List<FilteredHierarchy.FilterResult> list = new List<FilteredHierarchy.FilterResult>();
			string[] folders = this.m_SearchFilter.folders;
			for (int i = 0; i < folders.Length; i++)
			{
				string assetPath = folders[i];
				int mainAssetInstanceID = AssetDatabase.GetMainAssetInstanceID(assetPath);
				if (property.Find(mainAssetInstanceID, null))
				{
					int depth = property.depth;
					int[] array = new int[]
					{
						mainAssetInstanceID
					};
					while (property.Next(array))
					{
						if (property.depth <= depth)
						{
							break;
						}
						FilteredHierarchy.FilterResult item = new FilteredHierarchy.FilterResult();
						this.CopyPropertyData(ref item, property);
						list.Add(item);
						if (property.hasChildren && !property.isFolder)
						{
							Array.Resize<int>(ref array, array.Length + 1);
							array[array.Length - 1] = property.instanceID;
						}
					}
				}
			}
			this.m_Results = list.ToArray();
		}
		private void SearchInFolders(HierarchyProperty property)
		{
			List<FilteredHierarchy.FilterResult> list = new List<FilteredHierarchy.FilterResult>();
			string[] baseFolders = ProjectWindowUtil.GetBaseFolders(this.m_SearchFilter.folders);
			string[] array = baseFolders;
			for (int i = 0; i < array.Length; i++)
			{
				string assetPath = array[i];
				property.SetSearchFilter(new SearchFilter());
				int mainAssetInstanceID = AssetDatabase.GetMainAssetInstanceID(assetPath);
				if (property.Find(mainAssetInstanceID, null))
				{
					property.SetSearchFilter(this.m_SearchFilter);
					int depth = property.depth;
					int[] expanded = null;
					while (property.NextWithDepthCheck(expanded, depth + 1))
					{
						FilteredHierarchy.FilterResult item = new FilteredHierarchy.FilterResult();
						this.CopyPropertyData(ref item, property);
						list.Add(item);
					}
				}
			}
			this.m_Results = list.ToArray();
		}
 private void FolderBrowsing(HierarchyProperty property)
 {
   List<FilteredHierarchy.FilterResult> filterResultList = new List<FilteredHierarchy.FilterResult>();
   foreach (string folder in this.m_SearchFilter.folders)
   {
     int mainAssetInstanceId = AssetDatabase.GetMainAssetInstanceID(folder);
     if (property.Find(mainAssetInstanceId, (int[]) null))
     {
       int depth = property.depth;
       int[] array = new int[1]{ mainAssetInstanceId };
       while (property.Next(array) && property.depth > depth)
       {
         FilteredHierarchy.FilterResult result = new FilteredHierarchy.FilterResult();
         this.CopyPropertyData(ref result, property);
         filterResultList.Add(result);
         if (property.hasChildren && !property.isFolder)
         {
           Array.Resize<int>(ref array, array.Length + 1);
           array[array.Length - 1] = property.instanceID;
         }
       }
     }
   }
   this.m_Results = filterResultList.ToArray();
 }
 private void SearchInFolders(HierarchyProperty property)
 {
   List<FilteredHierarchy.FilterResult> filterResultList = new List<FilteredHierarchy.FilterResult>();
   foreach (string baseFolder in ProjectWindowUtil.GetBaseFolders(this.m_SearchFilter.folders))
   {
     property.SetSearchFilter(new SearchFilter());
     int mainAssetInstanceId = AssetDatabase.GetMainAssetInstanceID(baseFolder);
     if (property.Find(mainAssetInstanceId, (int[]) null))
     {
       property.SetSearchFilter(this.m_SearchFilter);
       int depth = property.depth;
       int[] expanded = (int[]) null;
       while (property.NextWithDepthCheck(expanded, depth + 1))
       {
         FilteredHierarchy.FilterResult result = new FilteredHierarchy.FilterResult();
         this.CopyPropertyData(ref result, property);
         filterResultList.Add(result);
       }
     }
   }
   this.m_Results = filterResultList.ToArray();
 }