UnityEngine.InternalStaticBatchingUtility.Combine C# (CSharp) Method

Combine() public static method

public static Combine ( GameObject staticBatchRoot, bool combineOnlyStatic, bool isEditorPostprocessScene ) : void
staticBatchRoot GameObject
combineOnlyStatic bool
isEditorPostprocessScene bool
return void
        public static void Combine(GameObject staticBatchRoot, bool combineOnlyStatic, bool isEditorPostprocessScene)
        {
            GameObject[] objArray = (GameObject[]) UnityEngine.Object.FindObjectsOfType(typeof(GameObject));
            List<GameObject> list = new List<GameObject>();
            foreach (GameObject obj2 in objArray)
            {
                if (((staticBatchRoot == null) || obj2.transform.IsChildOf(staticBatchRoot.transform)) && (!combineOnlyStatic || obj2.isStaticBatchable))
                {
                    list.Add(obj2);
                }
            }
            CombineGameObjects(list.ToArray(), staticBatchRoot, isEditorPostprocessScene);
        }

Usage Example

コード例 #1
0
        public static void Combine(GameObject staticBatchRoot, bool combineOnlyStatic)
        {
            GameObject[]      array = (GameObject[])Object.FindObjectsOfType(typeof(GameObject));
            List <GameObject> list  = new List <GameObject>();

            GameObject[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                GameObject gameObject = array2[i];
                if (!(staticBatchRoot != null) || gameObject.transform.IsChildOf(staticBatchRoot.transform))
                {
                    if (!combineOnlyStatic || gameObject.isStaticBatchable)
                    {
                        list.Add(gameObject);
                    }
                }
            }
            array = list.ToArray();
            if (!Application.HasProLicense() && !Application.HasAdvancedLicense() && staticBatchRoot != null && array.Length > 0)
            {
                Debug.LogError("Your Unity license is not sufficient for Static Batching.");
            }
            InternalStaticBatchingUtility.Combine(array, staticBatchRoot);
        }
All Usage Examples Of UnityEngine.InternalStaticBatchingUtility::Combine
InternalStaticBatchingUtility