Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 4732129

Browse files
committed
Added a warning to the debug component UI
1 parent 20f1835 commit 4732129

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

PostProcessing/Editor/PostProcessDebugEditor.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ public override void OnInspectorGUI()
6363
if (m_PostProcessLayer.objectReferenceValue == null)
6464
return;
6565

66-
EditorGUILayout.Space();
66+
if (AnyEnabled() && !m_Target.enabled)
67+
EditorGUILayout.HelpBox("The component is disabled but some monitors are still enabled and will be rendered internally. It is recommended to disable them to save performances unless they're needed elsewhere.", MessageType.Warning);
68+
else
69+
EditorGUILayout.Space();
6770

6871
m_Monitors.Update();
6972

@@ -75,6 +78,16 @@ public override void OnInspectorGUI()
7578
m_Monitors.ApplyModifiedProperties();
7679
}
7780

81+
bool AnyEnabled()
82+
{
83+
bool any = false;
84+
any |= m_LightMeterEnabled.boolValue;
85+
any |= m_HistogramEnabled.boolValue;
86+
any |= m_WaveformEnabled.boolValue;
87+
any |= m_VectorscopeEnabled.boolValue;
88+
return any;
89+
}
90+
7891
void DoMonitorGUI(GUIContent content, SerializedProperty prop, params SerializedProperty[] settings)
7992
{
8093
EditorGUILayout.PropertyField(prop, content);

0 commit comments

Comments
 (0)