Combine() public static method

public static Combine ( GameObject staticBatchRoot, bool combineOnlyStatic, bool isEditorPostprocessScene ) : void
staticBatchRoot GameObject
combineOnlyStatic bool
isEditorPostprocessScene bool
return void
コード例 #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);
        }
コード例 #2
0
 public static void CombineRoot(GameObject staticBatchRoot)
 {
     InternalStaticBatchingUtility.Combine(staticBatchRoot, false, false);
 }
コード例 #3
0
 public static void Combine(GameObject[] gos, GameObject staticBatchRoot)
 {
     InternalStaticBatchingUtility.Combine(gos, staticBatchRoot);
 }