GetTerrainGIChunks() private method

private GetTerrainGIChunks ( Terrain terrain, int &numChunksX, int &numChunksY ) : void
terrain UnityEngine.Terrain
numChunksX int
numChunksY int
return void
Beispiel #1
0
        void ShowTerrainChunks(Terrain[] terrains)
        {
            if (terrains == null)
            {
                return;
            }

            int terrainChunksX = 0, terrainChunksY = 0;

            foreach (var terrain in terrains)
            {
                int tmpChunksX = 0, tmpChunksY = 0;
                Lightmapping.GetTerrainGIChunks(terrain, ref tmpChunksX, ref tmpChunksY);
                if (terrainChunksX == 0 && terrainChunksY == 0)
                {
                    terrainChunksX = tmpChunksX;
                    terrainChunksY = tmpChunksY;
                }
                else if (terrainChunksX != tmpChunksX || terrainChunksY != tmpChunksY)
                {
                    terrainChunksX = terrainChunksY = 0;
                    break;
                }
            }
            if (terrainChunksX * terrainChunksY > 1)
            {
                EditorGUILayout.HelpBox(string.Format(L10n.Tr("Terrain is chunked up into {0} instances for baking."), terrainChunksX * terrainChunksY), MessageType.None);
            }
        }
        private void ShowTerrainChunks(Terrain[] terrains)
        {
            int num  = 0;
            int num2 = 0;

            foreach (Terrain terrain in terrains)
            {
                int numChunksX = 0;
                int numChunksY = 0;
                Lightmapping.GetTerrainGIChunks(terrain, ref numChunksX, ref numChunksY);
                if ((num == 0) && (num2 == 0))
                {
                    num  = numChunksX;
                    num2 = numChunksY;
                }
                else if ((num != numChunksX) || (num2 != numChunksY))
                {
                    num = num2 = 0;
                    break;
                }
            }
            if ((num * num2) > 1)
            {
                GUILayout.Label(string.Format("Terrain is chunked up into {0} instances for baking.", num * num2), EditorStyles.helpBox, new GUILayoutOption[0]);
            }
        }
        private void ShowTerrainChunks(Terrain[] terrains)
        {
            int num  = 0;
            int num2 = 0;

            for (int i = 0; i < terrains.Length; i++)
            {
                Terrain terrain = terrains[i];
                int     num3    = 0;
                int     num4    = 0;
                Lightmapping.GetTerrainGIChunks(terrain, ref num3, ref num4);
                if (num == 0 && num2 == 0)
                {
                    num  = num3;
                    num2 = num4;
                }
                else if (num != num3 || num2 != num4)
                {
                    num2 = (num = 0);
                    break;
                }
            }
            if (num * num2 > 1)
            {
                GUILayout.Label(string.Format("Terrain is chunked up into {0} instances for baking.", num * num2), EditorStyles.helpBox, new GUILayoutOption[0]);
            }
        }
Beispiel #4
0
        private void ShowTerrainChunks(Terrain[] terrains)
        {
            int num  = 0;
            int num2 = 0;

            for (int i = 0; i < terrains.Length; i++)
            {
                Terrain terrain = terrains[i];
                int     num3    = 0;
                int     num4    = 0;
                Lightmapping.GetTerrainGIChunks(terrain, ref num3, ref num4);
                if (num == 0 && num2 == 0)
                {
                    num  = num3;
                    num2 = num4;
                }
                else if (num != num3 || num2 != num4)
                {
                    num2 = (num = 0);
                    break;
                }
            }
            if (num * num2 > 1)
            {
                EditorGUILayout.HelpBox(string.Format("Terrain is chunked up into {0} instances for baking.", num * num2), MessageType.None);
            }
        }
        private void ShowTerrainChunks(Terrain[] terrains)
        {
            int num1 = 0;
            int num2 = 0;

            foreach (Terrain terrain in terrains)
            {
                int numChunksX = 0;
                int numChunksY = 0;
                Lightmapping.GetTerrainGIChunks(terrain, ref numChunksX, ref numChunksY);
                if (num1 == 0 && num2 == 0)
                {
                    num1 = numChunksX;
                    num2 = numChunksY;
                }
                else if (num1 != numChunksX || num2 != numChunksY)
                {
                    num1 = num2 = 0;
                    break;
                }
            }
            if (num1 * num2 <= 1)
            {
                return;
            }
            GUILayout.Label(string.Format("Terrain is chunked up into {0} instances for baking.", (object)(num1 * num2)), EditorStyles.helpBox, new GUILayoutOption[0]);
        }