public static CombineGameObjects ( |
||
gos | ||
staticBatchRoot | ||
isEditorPostprocessScene | bool | |
return | void |
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); }
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); }
public static void Combine(GameObject[] gos, GameObject staticBatchRoot) { InternalStaticBatchingUtility.CombineGameObjects(gos, staticBatchRoot, isEditorPostprocessScene: false); }
/// <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); }