protected override void DoInit()
        {
            List <GameObject> gameObjects = this.m_gameObjectList.GetGameObjects();

            for (int i = 0; i < gameObjects.Count; i++)
            {
                GameObject go = gameObjects[i];
                if (this.m_gameObjectList.CheckGameObject(go, false))
                {
                    SearchObjectInGameObjectTask task = new SearchObjectInGameObjectTask(go);
                    base.Add(task);
                }
            }
        }
Exemplo n.º 2
0
        private void UpdateSearchProgress(SearchObjectInGameObjectListJob job)
        {
            if (job == null)
            {
                return;
            }
            int num  = job.TaskCount();
            int num2 = job.CurrentIndex();
            SearchObjectInGameObjectTask searchObjectInGameObjectTask = job.Current() as SearchObjectInGameObjectTask;
            GameObject go   = searchObjectInGameObjectTask.Go;
            bool       flag = EditorUtility.DisplayCancelableProgressBar("Searching", "Search in: " + go.name, (float)(num2 + 1) / (float)num);

            if (flag)
            {
                job.SetFinished();
            }
        }
Exemplo n.º 3
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);
            }
        }