public void Show()
        {
            GameObject[] allObjects;

            if (location == RecordLocation.Scene)
            {
                if (CSSceneTools.GetCurrentScenePath() != path)
                {
                    if (!CSSceneTools.SaveCurrentSceneIfUserWantsTo())
                    {
                        return;
                    }
                    CSSceneTools.OpenScene(path);
                }

                allObjects = CSEditorTools.GetAllSuitableGameObjectsInCurrentScene();
                CSEditorTools.PingObjectDelayed(AssetDatabase.LoadAssetAtPath(path, typeof(Object)));
            }
            else
            {
                List <GameObject> prefabs = new List <GameObject>();
                CSEditorTools.GetAllSuitableGameObjectsInPrefabAssets(prefabs);
                allObjects = prefabs.ToArray();
            }

            GameObject go = FindObjectInCollection(allObjects);

            if (go != null)
            {
                if (location == RecordLocation.Scene)
                {
                    Selection.activeTransform = go.transform;
                }
                else
                {
                    Selection.activeGameObject = go;

                    if (gameObjectPath.Split('/').Length > 2)
                    {
                        CSEditorTools.PingObjectDelayed(AssetDatabase.LoadAssetAtPath(path, typeof(Object)));
                    }
                }
            }
            else
            {
                MaintainerWindow.ShowNotification("Can't find object " + gameObjectPath);
            }
        }
Esempio n. 2
0
        private GameObject GetGameObjectWithThisIssue()
        {
            GameObject[] allObjects;

            if (location == RecordLocation.Scene)
            {
                allObjects = CSEditorTools.GetAllSuitableGameObjectsInCurrentScene();
            }
            else
            {
                List <GameObject> prefabs = new List <GameObject>();
                CSEditorTools.GetAllSuitableGameObjectsInPrefabAssets(prefabs);
                allObjects = prefabs.ToArray();
            }

            return(FindObjectInCollection(allObjects));
        }