protected override void DoInit()
 {
     if (!this.m_folderList.CheckFolder(this.m_folderPath, false))
     {
         base.Cancel();
         return;
     }
     if (this.m_searchType == SearchType.Prefab)
     {
         List <string> filePaths = TnEditorFileUtil.GetFilePaths(this.m_folderPath, "*.prefab", SearchOption.AllDirectories, "*.meta", true);
         for (int i = 0; i < filePaths.Count; i++)
         {
             SearchObjectInPrefabTask task = new SearchObjectInPrefabTask(filePaths[i]);
             base.Add(task);
         }
     }
     else if (this.m_searchType == SearchType.FBX)
     {
         List <string> filePaths = TnEditorFileUtil.GetFilePaths(this.m_folderPath, "*.fbx", SearchOption.AllDirectories, "*.meta", true);
         for (int i = 0; i < filePaths.Count; i++)
         {
             SearchObjectInPrefabTask task = new SearchObjectInPrefabTask(filePaths[i]);
             base.Add(task);
         }
     }
     else if (this.m_searchType == SearchType.Material)
     {
         List <string> filePaths = TnEditorFileUtil.GetFilePaths(this.m_folderPath, "*.mat", SearchOption.AllDirectories, "*.meta", true);
         for (int i = 0; i < filePaths.Count; i++)
         {
             SearchObjectInMaterialTask task = new SearchObjectInMaterialTask(filePaths[i]);
             base.Add(task);
         }
     }
 }
Esempio n. 2
0
        protected override void DoInit()
        {
            if (!this.m_folderList.CheckFolder(this.m_folderPath, false))
            {
                base.Cancel();
                return;
            }
            List <string> filePaths = TnEditorFileUtil.GetFilePaths(this.m_folderPath, "*.*", SearchOption.AllDirectories, "*.meta", true);

            for (int i = 0; i < filePaths.Count; i++)
            {
                SearchMissingInPrefabTask task = new SearchMissingInPrefabTask(filePaths[i]);
                base.Add(task);
            }
        }
        public List <SearchResult> SearchInFolder(string folderPath)
        {
            List <SearchResult> list = new List <SearchResult>();

            if (!this.m_folderList.CheckFolder(folderPath, false))
            {
                return(list);
            }
            List <string> filePaths = TnEditorFileUtil.GetFilePaths(folderPath, "*.*", SearchOption.AllDirectories, ".meta", true);

            for (int i = 0; i < filePaths.Count; i++)
            {
                string fileName = Path.GetFileName(filePaths[i]);
                if (EditorUtility.DisplayCancelableProgressBar("Searching", "Search in: " + fileName, (float)(i + 1) / (float)filePaths.Count))
                {
                    break;
                }
                this.SearchInPrefab(filePaths[i], list);
            }
            EditorUtility.ClearProgressBar();
            return(list);
        }