Ejemplo n.º 1
0
 private static void GetObjectsRecurse(Transform root, List <GameObject> arr)
 {
     arr.Add(root.gameObject);
     foreach (Transform root2 in root)
     {
         SceneModeUtility.GetObjectsRecurse(root2, arr);
     }
 }
Ejemplo n.º 2
0
        public static GameObject[] GetObjects(UnityEngine.Object[] gameObjects, bool includeChildren)
        {
            List <GameObject> arr = new List <GameObject>();

            if (!includeChildren)
            {
                foreach (GameObject gameObject in gameObjects)
                {
                    arr.Add(gameObject);
                }
            }
            else
            {
                foreach (GameObject gameObject in gameObjects)
                {
                    SceneModeUtility.GetObjectsRecurse(gameObject.transform, arr);
                }
            }
            return(arr.ToArray());
        }
Ejemplo n.º 3
0
        public static GameObject[] GetObjects(UnityEngine.Object[] gameObjects, bool includeChildren)
        {
            List <GameObject> list = new List <GameObject>();

            if (!includeChildren)
            {
                for (int i = 0; i < gameObjects.Length; i++)
                {
                    GameObject item = (GameObject)gameObjects[i];
                    list.Add(item);
                }
            }
            else
            {
                for (int j = 0; j < gameObjects.Length; j++)
                {
                    GameObject gameObject = (GameObject)gameObjects[j];
                    SceneModeUtility.GetObjectsRecurse(gameObject.transform, list);
                }
            }
            return(list.ToArray());
        }
Ejemplo n.º 4
0
        private static void GetObjectsRecurse(Transform root, List <GameObject> arr)
        {
            arr.Add(root.gameObject);
            IEnumerator enumerator = root.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Transform root2 = (Transform)enumerator.Current;
                    SceneModeUtility.GetObjectsRecurse(root2, arr);
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
        }