AmbientOcclusionModelEditor.cs
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using UnityEngine.PostProcessing;
namespace UnityEditor.PostProcessing
{
using Settings = AmbientOcclusionModel.Settings;
[PostProcessingModelEditor(typeof(AmbientOcclusionModel))]
public class AmbientOcclusionModelEditor : PostProcessingModelEditor
{
SerializedProperty m_Intensity;
SerializedProperty m_Radius;
SerializedProperty m_SampleCount;
SerializedProperty m_Downsampling;
SerializedProperty m_ForceForwardCompatibility;
SerializedProperty m_AmbientOnly;
SerializedProperty m_HighPrecision;
public override void OnEnable()
{
m_Intensity = FindSetting((Settings x) => x.intensity);
m_Radius = FindSetting((Settings x) => x.radius);
m_SampleCount = FindSetting((Settings x) => x.sampleCount);
m_Downsampling = FindSetting((Settings x) => x.downsampling);
m_ForceForwardCompatibility = FindSetting((Settings x) => x.forceForwardCompatibility);
m_AmbientOnly = FindSetting((Settings x) => x.ambientOnly);
m_HighPrecision = FindSetting((Settings x) => x.highPrecision);
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(m_Intensity);
EditorGUILayout.PropertyField(m_Radius);
EditorGUILayout.PropertyField(m_SampleCount);
EditorGUILayout.PropertyField(m_Downsampling);
EditorGUILayout.PropertyField(m_ForceForwardCompatibility);
EditorGUILayout.PropertyField(m_HighPrecision, EditorGUIHelper.GetContent("High Precision (Forward)"));
using (new EditorGUI.DisabledGroupScope(m_ForceForwardCompatibility.boolValue))
EditorGUILayout.PropertyField(m_AmbientOnly, EditorGUIHelper.GetContent("Ambient Only (Deferred + HDR)"));
}
}
}