42 lines
1.9 KiB
C#
42 lines
1.9 KiB
C#
using UnityEditor;
|
|
using UnityEditor.Rendering.HighDefinition;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.Toonshader.Editor
|
|
{
|
|
[CustomPassDrawerAttribute(typeof(UTSOutlinePass))]
|
|
public class UTSOutlinePassEditor : CustomPassDrawer
|
|
{
|
|
SerializedProperty m_RenderQueueType;
|
|
SerializedProperty m_SortingCriteria;
|
|
SerializedProperty m_LayerMask;
|
|
|
|
protected override void Initialize(SerializedProperty customPass)
|
|
{
|
|
m_RenderQueueType = customPass.FindPropertyRelative("renderQueueType");
|
|
m_SortingCriteria = customPass.FindPropertyRelative("sortingCriteria");
|
|
m_LayerMask = customPass.FindPropertyRelative("layerMask");
|
|
}
|
|
|
|
protected override void DoPassGUI(SerializedProperty customPass, Rect rect)
|
|
{
|
|
EditorGUI.BeginProperty(rect, new GUIContent("Queue", "Filter the render queue range you want to render."), m_RenderQueueType);
|
|
EditorGUI.PropertyField(rect, m_RenderQueueType, new GUIContent("Queue", "Filter the render queue range you want to render."));
|
|
EditorGUI.EndProperty();
|
|
rect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
|
|
|
EditorGUI.PropertyField(rect, m_SortingCriteria, new GUIContent("Sorting Criteria", "Sorting settings used to render objects in a certain order."));
|
|
rect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
|
|
|
EditorGUI.PropertyField(rect, m_LayerMask, new GUIContent("Layer Mask", "Chose the Callback position for this render pass object."));
|
|
rect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
|
}
|
|
|
|
protected override float GetPassHeight(SerializedProperty customPass)
|
|
{
|
|
return (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) * 3;
|
|
}
|
|
|
|
}
|
|
}
|