您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

44 行
1.2 KiB

using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEditor;
using UnityEditor.Rendering.HighDefinition;
[CustomPassDrawer(typeof(NormalBufferBlurPass))]
class NormalBufferBlurPassDrawer : CustomPassDrawer
{
static readonly float lineFeed = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
SerializedProperty queue;
SerializedProperty layerMask;
protected override void Initialize(SerializedProperty customPass)
{
queue = customPass.FindPropertyRelative("queue");
layerMask = customPass.FindPropertyRelative("layerMask");
}
protected override PassUIFlag commonPassUIFlags => PassUIFlag.Name;
protected override float GetPassHeight(SerializedProperty customPass)
{
float height = base.GetPassHeight(customPass);
height += lineFeed;
height += lineFeed;
return height;
}
protected override void DoPassGUI(SerializedProperty customPass, Rect rect)
{
base.DoPassGUI(customPass, rect);
// queue
queue.intValue = (int)(CustomPass.RenderQueueType)EditorGUI.EnumPopup(rect, "Queue", (CustomPass.RenderQueueType)queue.intValue);
rect.y += lineFeed;
// layerMask
EditorGUI.PropertyField(rect, layerMask);
rect.y += lineFeed;
}
}