Beispiel #1
0
 // ReSharper disable once SuggestBaseTypeForParameter
 private static void FindSceneObject(int indent, Transform objects, SceneHierarchyObject parent)
 {
     foreach (Transform @object in objects)
     {
         SceneHierarchyObject current = new SceneHierarchyObject(parent, @object.gameObject, indent);
         SCENE_HIERARCHY.Add(current);
         if (@object.childCount > 0)
         {
             FindSceneObject(indent + 1, @object, current);
         }
     }
 }
Beispiel #2
0
        private static bool CheckUnfolded(SceneHierarchyObject @object)
        {
            bool isUnfolded = true;

            SceneHierarchyObject current = @object;

            while (current.Parent != null)
            {
                if (!current.Parent.IsUnfolded)
                {
                    isUnfolded = false;
                    break;
                }

                current = current.Parent;
            }

            return(isUnfolded);
        }
Beispiel #3
0
        //+ HELPERS
        private static void FindSceneObject()
        {
            SCENE_HIERARCHY.Clear();
            IEnumerable <GameObject> objects = selectedScene == -2
                                ? Resources.FindObjectsOfTypeAll <GameObject>().Where(o => o.transform.parent == null && o.scene.name == null)
                                : Resources.FindObjectsOfTypeAll <GameObject>().Where(o => (o.scene.name?.Equals(selectedScene == -1 ? DONT_DESTROY_SCENE : ALL_SCENES[selectedScene].name) ?? false) && o.transform.parent == null);

            foreach (GameObject @object in objects)
            {
                SceneHierarchyObject current = new SceneHierarchyObject(@object, 0);
                SCENE_HIERARCHY.Add(current);
                if (@object.transform.childCount > 0)
                {
                    FindSceneObject(1, @object.transform, current);
                }
            }

            if (SCENE_HIERARCHY.Count > 0)
            {
                SelectObject(SCENE_HIERARCHY[0].GameObject);
            }
        }
Beispiel #4
0
 internal SceneHierarchyObject(SceneHierarchyObject parent, GameObject gameObject, int indent)
 {
     Parent      = parent;
     GameObject  = gameObject;
     ChildIndent = indent;
 }