您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
64 行
2.5 KiB
64 行
2.5 KiB
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEditor.Rendering.Universal
|
|
{
|
|
internal static class ResourceGuid
|
|
{
|
|
public static readonly string rendererTemplate = "51493ed8d97d3c24b94c6cffe834630b";
|
|
}
|
|
|
|
static class EditorUtils
|
|
{
|
|
// Each group is separate in the menu by a menu bar
|
|
public const int lwrpAssetCreateMenuPriorityGroup1 = CoreUtils.assetCreateMenuPriority1;
|
|
public const int lwrpAssetCreateMenuPriorityGroup2 = CoreUtils.assetCreateMenuPriority1 + 50;
|
|
public const int lwrpAssetCreateMenuPriorityGroup3 = lwrpAssetCreateMenuPriorityGroup2 + 50;
|
|
|
|
internal class Styles
|
|
{
|
|
//Measurements
|
|
public static float defaultLineSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
|
public static float defaultIndentWidth = 12;
|
|
}
|
|
|
|
public static void DrawCascadeSplitGUI<T>(ref SerializedProperty shadowCascadeSplit)
|
|
{
|
|
float[] cascadePartitionSizes = null;
|
|
Type type = typeof(T);
|
|
if (type == typeof(float))
|
|
{
|
|
cascadePartitionSizes = new float[] { shadowCascadeSplit.floatValue };
|
|
}
|
|
else if (type == typeof(Vector3))
|
|
{
|
|
Vector3 splits = shadowCascadeSplit.vector3Value;
|
|
cascadePartitionSizes = new float[]
|
|
{
|
|
Mathf.Clamp(splits[0], 0.0f, 1.0f),
|
|
Mathf.Clamp(splits[1] - splits[0], 0.0f, 1.0f),
|
|
Mathf.Clamp(splits[2] - splits[1], 0.0f, 1.0f)
|
|
};
|
|
}
|
|
if (cascadePartitionSizes != null)
|
|
{
|
|
EditorGUI.BeginChangeCheck();
|
|
ShadowCascadeSplitGUI.HandleCascadeSliderGUI(ref cascadePartitionSizes);
|
|
if (EditorGUI.EndChangeCheck())
|
|
{
|
|
if (type == typeof(float))
|
|
shadowCascadeSplit.floatValue = cascadePartitionSizes[0];
|
|
else
|
|
{
|
|
Vector3 updatedValue = new Vector3();
|
|
updatedValue[0] = cascadePartitionSizes[0];
|
|
updatedValue[1] = updatedValue[0] + cascadePartitionSizes[1];
|
|
updatedValue[2] = updatedValue[1] + cascadePartitionSizes[2];
|
|
shadowCascadeSplit.vector3Value = updatedValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|