您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
42 行
1.2 KiB
42 行
1.2 KiB
#if HDRP_PRESENT
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.Rendering.HighDefinition;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.Perception.GroundTruth
|
|
{
|
|
public class BaseCustomPassDrawer : CustomPassDrawer
|
|
{
|
|
List<SerializedProperty> m_CustomPassUserProperties = new List<SerializedProperty>();
|
|
static float s_DefaultLineSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
|
|
|
protected void AddProperty(SerializedProperty property)
|
|
{
|
|
m_CustomPassUserProperties.Add(property);
|
|
}
|
|
|
|
protected override void DoPassGUI(SerializedProperty customPass, Rect rect)
|
|
{
|
|
foreach (var prop in m_CustomPassUserProperties)
|
|
{
|
|
EditorGUI.PropertyField(rect, prop);
|
|
rect.y += s_DefaultLineSpace;
|
|
}
|
|
}
|
|
|
|
protected override float GetPassHeight(SerializedProperty customPass)
|
|
{
|
|
float height = 0f;
|
|
foreach (var prop in m_CustomPassUserProperties)
|
|
{
|
|
height += EditorGUI.GetPropertyHeight(prop);
|
|
height += EditorGUIUtility.standardVerticalSpacing;
|
|
}
|
|
|
|
return height;
|
|
}
|
|
}
|
|
}
|
|
#endif
|