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);
         }
     }
 }
Example #2
0
        private void HandleOnTaskProcess(TnAbstractTask task)
        {
            Type type = task.GetType();

            if (type == typeof(SearchObjectInPrefabTask))
            {
                SearchObjectInPrefabTask searchObjectInPrefabTask = task as SearchObjectInPrefabTask;
                this.ProcessSearchInPrefab(searchObjectInPrefabTask.FilePath);
            }
            else if (type == typeof(SearchObjectInMaterialTask))
            {
                SearchObjectInMaterialTask searchObjectInMaterialTask = task as SearchObjectInMaterialTask;
                this.ProcessSearchInMaterial(searchObjectInMaterialTask.FilePath);
            }
            else if (type == typeof(SearchObjectInGameObjectTask))
            {
                SearchObjectInGameObjectTask searchObjectInGameObjectTask = task as SearchObjectInGameObjectTask;
                this.ProcessSearchInGameObject(searchObjectInGameObjectTask.Go);
            }
        }