CombineGameObjects() public static method

public static CombineGameObjects ( GameObject gos, GameObject staticBatchRoot, bool isEditorPostprocessScene ) : void
gos GameObject
staticBatchRoot GameObject
isEditorPostprocessScene bool
return void
コード例 #1
0
        public static void Combine(GameObject staticBatchRoot, bool combineOnlyStatic, bool isEditorPostprocessScene)
        {
            GameObject[]      objectsOfType  = (GameObject[])Object.FindObjectsOfType(typeof(GameObject));
            List <GameObject> gameObjectList = new List <GameObject>();

            foreach (GameObject gameObject in objectsOfType)
            {
                if ((!((Object)staticBatchRoot != (Object)null) || gameObject.transform.IsChildOf(staticBatchRoot.transform)) && (!combineOnlyStatic || gameObject.isStaticBatchable))
                {
                    gameObjectList.Add(gameObject);
                }
            }
            InternalStaticBatchingUtility.CombineGameObjects(gameObjectList.ToArray(), staticBatchRoot, isEditorPostprocessScene);
        }
コード例 #2
0
        public static void Combine(GameObject staticBatchRoot, bool combineOnlyStatic, bool isEditorPostprocessScene)
        {
            GameObject[]      array = (GameObject[])Object.FindObjectsOfType(typeof(GameObject));
            List <GameObject> list  = new List <GameObject>();

            foreach (GameObject gameObject in array)
            {
                if (!(staticBatchRoot != null) || gameObject.transform.IsChildOf(staticBatchRoot.transform))
                {
                    if (!combineOnlyStatic || gameObject.isStaticBatchable)
                    {
                        list.Add(gameObject);
                    }
                }
            }
            array = list.ToArray();
            InternalStaticBatchingUtility.CombineGameObjects(array, staticBatchRoot, isEditorPostprocessScene);
        }
コード例 #3
0
 public static void Combine(GameObject[] gos, GameObject staticBatchRoot)
 {
     InternalStaticBatchingUtility.CombineGameObjects(gos, staticBatchRoot, isEditorPostprocessScene: false);
 }
コード例 #4
0
 /// <summary>
 ///   <para>Combine will prepare all gos for the static batching. staticBatchRoot will be treated as their parent.</para>
 /// </summary>
 /// <param name="gos"></param>
 /// <param name="staticBatchRoot"></param>
 public static void Combine(GameObject[] gos, GameObject staticBatchRoot)
 {
     InternalStaticBatchingUtility.CombineGameObjects(gos, staticBatchRoot, false);
 }