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

            if (type == typeof(SearchMissingInPrefabTask))
            {
                SearchMissingInPrefabTask searchMissingInPrefabTask = task as SearchMissingInPrefabTask;
                this.ProcessSearchInPrefab(searchMissingInPrefabTask.FilePath);
                return;
            }
            if (type == typeof(SearchMissingInGameObjectTask))
            {
                SearchMissingInGameObjectTask searchMissingInGameObjectTask = task as SearchMissingInGameObjectTask;
                this.ProcessSearchInGameObject(searchMissingInGameObjectTask.Go);
            }
        }
        private void UpdateSearchProgress(SearchMissingInFolderListJob job1)
        {
            if (job1 == null)
            {
                return;
            }
            SearchMissingInFolderJob searchMissingInFolderJob = job1.Current() as SearchMissingInFolderJob;
            string folderPath = searchMissingInFolderJob.FolderPath;
            int    num        = searchMissingInFolderJob.TaskCount();
            int    num2       = searchMissingInFolderJob.CurrentIndex();
            SearchMissingInPrefabTask searchMissingInPrefabTask = searchMissingInFolderJob.Current() as SearchMissingInPrefabTask;
            string filePath = searchMissingInPrefabTask.FilePath;
            string fileName = Path.GetFileName(filePath);
            bool   flag     = EditorUtility.DisplayCancelableProgressBar("Searching: " + folderPath, "Search in: " + fileName, (float)(num2 + 1) / (float)num);

            if (flag)
            {
                job1.SetFinished();
            }
        }