浏览代码

Clearer GUI code.

/main
Yao Xiaoling 6 年前
当前提交
0a1673f2
共有 1 个文件被更改,包括 15 次插入13 次删除
  1. 28
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/TerrainLit/TerrainLitUI.cs

28
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/TerrainLit/TerrainLitUI.cs


if (terrainLayer.diffuseTexture != null)
{
var rect = GUILayoutUtility.GetLastRect();
rect.y += 16 + 4;
rect.width = EditorGUIUtility.labelWidth + 64;
rect.y += 16;
var tintRect = EditorGUI.PrefixLabel(rect, styles.colorTint);
--EditorGUI.indentLevel;
tintRect.width = 64;
diffuseTint = EditorGUI.ColorField(tintRect, GUIContent.none, diffuseTint, true, false, false);
diffuseTint = EditorGUI.ColorField(rect, styles.colorTint, diffuseTint, true, false, false);
diffuseRemapMax.x = diffuseTint.r;
diffuseRemapMax.y = diffuseTint.g;
diffuseRemapMax.z = diffuseTint.b;

{
rect.y += 16;
++EditorGUI.indentLevel;
var densityToggleRect = EditorGUI.PrefixLabel(rect, styles.opacityAsDensity);
--EditorGUI.indentLevel;
densityToggleRect.width = 64;
enableDensity = EditorGUI.Toggle(densityToggleRect, diffuseRemapMin.w > 0);
rect.y = rect.yMax + 2;
enableDensity = EditorGUI.Toggle(rect, styles.opacityAsDensity, diffuseRemapMin.w > 0);
--EditorGUI.indentLevel;
}
diffuseRemapMax.w = 1;
diffuseRemapMin.w = enableDensity ? 1 : 0;

if (terrainLayer.normalMapTexture != null)
{
var rect = GUILayoutUtility.GetLastRect();
rect.y += 16 + 4;
rect.width = EditorGUIUtility.labelWidth + 64;
rect.height = 16;
terrainLayer.normalScale = EditorGUILayout.FloatField(styles.normalScale, terrainLayer.normalScale);
terrainLayer.normalScale = EditorGUI.FloatField(rect, styles.normalScale, terrainLayer.normalScale);
EditorGUILayout.Space();
}
terrainLayer.maskMapTexture = EditorGUILayout.ObjectField(heightBlend ? styles.maskMapTexture : styles.maskMapTextureWithoutHeight, terrainLayer.maskMapTexture, typeof(Texture2D), false) as Texture2D;

正在加载...
取消
保存