您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
37 行
1.4 KiB
37 行
1.4 KiB
using UnityEngine.PostProcessing;
|
|
|
|
namespace UnityEditor.PostProcessing
|
|
{
|
|
using Settings = DepthOfFieldModel.Settings;
|
|
|
|
[PostProcessingModelEditor(typeof(DepthOfFieldModel))]
|
|
public class DepthOfFieldModelEditor : PostProcessingModelEditor
|
|
{
|
|
SerializedProperty m_FocusDistance;
|
|
SerializedProperty m_Aperture;
|
|
SerializedProperty m_FocalLength;
|
|
SerializedProperty m_UseCameraFov;
|
|
SerializedProperty m_KernelSize;
|
|
|
|
public override void OnEnable()
|
|
{
|
|
m_FocusDistance = FindSetting((Settings x) => x.focusDistance);
|
|
m_Aperture = FindSetting((Settings x) => x.aperture);
|
|
m_FocalLength = FindSetting((Settings x) => x.focalLength);
|
|
m_UseCameraFov = FindSetting((Settings x) => x.useCameraFov);
|
|
m_KernelSize = FindSetting((Settings x) => x.kernelSize);
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
EditorGUILayout.PropertyField(m_FocusDistance);
|
|
EditorGUILayout.PropertyField(m_Aperture, EditorGUIHelper.GetContent("Aperture (f-stop)"));
|
|
|
|
EditorGUILayout.PropertyField(m_UseCameraFov, EditorGUIHelper.GetContent("Use Camera FOV"));
|
|
if (!m_UseCameraFov.boolValue)
|
|
EditorGUILayout.PropertyField(m_FocalLength, EditorGUIHelper.GetContent("Focal Length (mm)"));
|
|
|
|
EditorGUILayout.PropertyField(m_KernelSize);
|
|
}
|
|
}
|
|
}
|