UnityEditor.TerrainInspector.ShowSettings C# (CSharp) Method

ShowSettings() public method

public ShowSettings ( ) : void
return void
        public void ShowSettings()
        {
            TerrainData terrainData = this.m_Terrain.terrainData;
            EditorGUI.BeginChangeCheck();
            GUILayout.Label("Base Terrain", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.m_Terrain.drawHeightmap = EditorGUILayout.Toggle("Draw", this.m_Terrain.drawHeightmap, new GUILayoutOption[0]);
            this.m_Terrain.heightmapPixelError = EditorGUILayout.Slider("Pixel Error", this.m_Terrain.heightmapPixelError, 1f, 200f, new GUILayoutOption[0]);
            this.m_Terrain.basemapDistance = EditorGUILayout.Slider("Base Map Dist.", this.m_Terrain.basemapDistance, 0f, 2000f, new GUILayoutOption[0]);
            this.m_Terrain.castShadows = EditorGUILayout.Toggle("Cast Shadows", this.m_Terrain.castShadows, new GUILayoutOption[0]);
            this.m_Terrain.materialType = (Terrain.MaterialType) EditorGUILayout.EnumPopup("Material", this.m_Terrain.materialType, new GUILayoutOption[0]);
            if (this.m_Terrain.materialType != Terrain.MaterialType.Custom)
            {
                this.m_Terrain.materialTemplate = null;
            }
            this.m_ShowBuiltinSpecularSettings.target = this.m_Terrain.materialType == Terrain.MaterialType.BuiltInLegacySpecular;
            this.m_ShowCustomMaterialSettings.target = this.m_Terrain.materialType == Terrain.MaterialType.Custom;
            this.m_ShowReflectionProbesGUI.target = (this.m_Terrain.materialType == Terrain.MaterialType.BuiltInStandard) || (this.m_Terrain.materialType == Terrain.MaterialType.Custom);
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowBuiltinSpecularSettings.faded))
            {
                EditorGUI.indentLevel++;
                this.m_Terrain.legacySpecular = EditorGUILayout.ColorField("Specular Color", this.m_Terrain.legacySpecular, new GUILayoutOption[0]);
                this.m_Terrain.legacyShininess = EditorGUILayout.Slider("Shininess", this.m_Terrain.legacyShininess, 0.03f, 1f, new GUILayoutOption[0]);
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowCustomMaterialSettings.faded))
            {
                EditorGUI.indentLevel++;
                this.m_Terrain.materialTemplate = EditorGUILayout.ObjectField("Custom Material", this.m_Terrain.materialTemplate, typeof(Material), false, new GUILayoutOption[0]) as Material;
                if ((this.m_Terrain.materialTemplate != null) && ShaderUtil.HasTangentChannel(this.m_Terrain.materialTemplate.shader))
                {
                    EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Can't use materials with shaders which need tangent geometry on terrain, use shaders in Nature/Terrain instead.").text, MessageType.Warning, false);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndFadeGroup();
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowReflectionProbesGUI.faded))
            {
                this.m_Terrain.reflectionProbeUsage = (ReflectionProbeUsage) EditorGUILayout.EnumPopup("Reflection Probes", this.m_Terrain.reflectionProbeUsage, new GUILayoutOption[0]);
                if (this.m_Terrain.reflectionProbeUsage != ReflectionProbeUsage.Off)
                {
                    EditorGUI.indentLevel++;
                    this.m_Terrain.GetClosestReflectionProbes(this.m_BlendInfoList);
                    RendererEditorBase.Probes.ShowClosestReflectionProbes(this.m_BlendInfoList);
                    EditorGUI.indentLevel--;
                }
            }
            EditorGUILayout.EndFadeGroup();
            terrainData.thickness = EditorGUILayout.FloatField("Thickness", terrainData.thickness, new GUILayoutOption[0]);
            GUILayout.Label("Tree & Detail Objects", EditorStyles.boldLabel, new GUILayoutOption[0]);
            this.m_Terrain.drawTreesAndFoliage = EditorGUILayout.Toggle("Draw", this.m_Terrain.drawTreesAndFoliage, new GUILayoutOption[0]);
            this.m_Terrain.bakeLightProbesForTrees = EditorGUILayout.Toggle(styles.bakeLightProbesForTrees, this.m_Terrain.bakeLightProbesForTrees, new GUILayoutOption[0]);
            if (this.m_Terrain.bakeLightProbesForTrees)
            {
                EditorGUILayout.HelpBox("GPU instancing is disabled for trees if light probes are used. Performance may be affected.", MessageType.Info);
            }
            this.m_Terrain.detailObjectDistance = EditorGUILayout.Slider("Detail Distance", this.m_Terrain.detailObjectDistance, 0f, 250f, new GUILayoutOption[0]);
            this.m_Terrain.collectDetailPatches = EditorGUILayout.Toggle("Collect Detail Patches", this.m_Terrain.collectDetailPatches, new GUILayoutOption[0]);
            this.m_Terrain.detailObjectDensity = EditorGUILayout.Slider("Detail Density", this.m_Terrain.detailObjectDensity, 0f, 1f, new GUILayoutOption[0]);
            this.m_Terrain.treeDistance = EditorGUILayout.Slider("Tree Distance", this.m_Terrain.treeDistance, 0f, 2000f, new GUILayoutOption[0]);
            this.m_Terrain.treeBillboardDistance = EditorGUILayout.Slider("Billboard Start", this.m_Terrain.treeBillboardDistance, 5f, 2000f, new GUILayoutOption[0]);
            this.m_Terrain.treeCrossFadeLength = EditorGUILayout.Slider("Fade Length", this.m_Terrain.treeCrossFadeLength, 0f, 200f, new GUILayoutOption[0]);
            this.m_Terrain.treeMaximumFullLODCount = EditorGUILayout.IntSlider("Max Mesh Trees", this.m_Terrain.treeMaximumFullLODCount, 0, 0x2710, new GUILayoutOption[0]);
            if (Event.current.type == EventType.Layout)
            {
                this.m_LODTreePrototypePresent = false;
                for (int i = 0; i < terrainData.treePrototypes.Length; i++)
                {
                    if (TerrainEditorUtility.IsLODTreePrototype(terrainData.treePrototypes[i].prefab))
                    {
                        this.m_LODTreePrototypePresent = true;
                        break;
                    }
                }
            }
            if (this.m_LODTreePrototypePresent)
            {
                EditorGUILayout.HelpBox("Tree Distance, Billboard Start, Fade Length and Max Mesh Trees have no effect on SpeedTree trees. Please use the LOD Group component on the tree prefab to control LOD settings.", MessageType.Info);
            }
            if (EditorGUI.EndChangeCheck())
            {
                EditorApplication.SetSceneRepaintDirty();
                EditorUtility.SetDirty(this.m_Terrain);
                if (!EditorApplication.isPlaying)
                {
                    EditorSceneManager.MarkSceneDirty(this.m_Terrain.gameObject.scene);
                }
            }
            EditorGUI.BeginChangeCheck();
            GUILayout.Label("Wind Settings for Grass", EditorStyles.boldLabel, new GUILayoutOption[0]);
            float num2 = EditorGUILayout.Slider("Speed", terrainData.wavingGrassStrength, 0f, 1f, new GUILayoutOption[0]);
            float num3 = EditorGUILayout.Slider("Size", terrainData.wavingGrassSpeed, 0f, 1f, new GUILayoutOption[0]);
            float num4 = EditorGUILayout.Slider("Bending", terrainData.wavingGrassAmount, 0f, 1f, new GUILayoutOption[0]);
            Color color = EditorGUILayout.ColorField("Grass Tint", terrainData.wavingGrassTint, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                terrainData.wavingGrassStrength = num2;
                terrainData.wavingGrassSpeed = num3;
                terrainData.wavingGrassAmount = num4;
                terrainData.wavingGrassTint = color;
                if (!EditorUtility.IsPersistent(terrainData) && !EditorApplication.isPlaying)
                {
                    EditorSceneManager.MarkSceneDirty(this.m_Terrain.gameObject.scene);
                }
            }
            this.ShowResolution();
            this.ShowHeightmaps();
        }