|
1 | | -using UnityEngine; |
2 | 1 | using UnityEngine.PostProcessing; |
3 | 2 |
|
4 | 3 | namespace UnityEditor.PostProcessing |
5 | 4 | { |
6 | 5 | using Settings = FogModel.Settings; |
7 | 6 |
|
8 | | - [PostProcessingModelEditor(typeof(FogModel))] |
| 7 | + [PostProcessingModelEditor(typeof(FogModel), alwaysEnabled: true)] |
9 | 8 | public class FogModelEditor : PostProcessingModelEditor |
10 | 9 | { |
11 | | - SerializedProperty m_Color; |
12 | | - SerializedProperty m_Mode; |
13 | | - SerializedProperty m_Density; |
14 | | - SerializedProperty m_Start; |
15 | | - SerializedProperty m_End; |
16 | 10 | SerializedProperty m_ExcludeSkybox; |
17 | 11 |
|
18 | 12 | public override void OnEnable() |
19 | 13 | { |
20 | | - m_Color = FindSetting((Settings x) => x.color); |
21 | | - m_Mode = FindSetting((Settings x) => x.mode); |
22 | | - m_Density = FindSetting((Settings x) => x.density); |
23 | | - m_Start = FindSetting((Settings x) => x.start); |
24 | | - m_End = FindSetting((Settings x) => x.end); |
25 | 14 | m_ExcludeSkybox = FindSetting((Settings x) => x.excludeSkybox); |
26 | 15 | } |
27 | 16 |
|
28 | 17 | public override void OnInspectorGUI() |
29 | 18 | { |
30 | | - EditorGUILayout.PropertyField(m_Color); |
31 | | - EditorGUILayout.PropertyField(m_ExcludeSkybox); |
32 | | - EditorGUILayout.PropertyField(m_Mode); |
33 | | - |
34 | | - EditorGUI.indentLevel++; |
35 | | - if (m_Mode.intValue == (int)FogMode.Linear) |
36 | | - { |
37 | | - EditorGUILayout.PropertyField(m_Start); |
38 | | - EditorGUILayout.PropertyField(m_End); |
39 | | - } |
40 | | - else |
41 | | - { |
42 | | - EditorGUILayout.PropertyField(m_Density); |
43 | | - } |
| 19 | + EditorGUILayout.HelpBox("This effect adds fog compatibility to the deferred rendering path; actual fog settings should be set in the Lighting panel.", MessageType.Info); |
| 20 | + EditorGUILayout.PropertyField(m_ExcludeSkybox, EditorGUIHelper.GetContent("Exclude Skybox (deferred only)")); |
44 | 21 | EditorGUI.indentLevel--; |
45 | 22 | } |
46 | 23 | } |
|
0 commit comments