Skip to content

Commit a1825fd

Browse files
committed
refactored HDRenderLoopInspector
1 parent 5a01382 commit a1825fd

File tree

1 file changed

+32
-12
lines changed

1 file changed

+32
-12
lines changed

Assets/ScriptableRenderLoop/HDRenderLoop/Editor/HDRenderLoopInspector.cs

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private class Styles
4343
public readonly int[] shadowsCascadeCountValues = new int[] { 1, 2, 3, 4 };
4444
public readonly GUIContent shadowsCascades = new GUIContent("Cascade values");
4545

46-
public readonly GUIContent tileLightLoopSettings = new GUIContent("Tile Light Loop settings");
46+
public readonly GUIContent tileLightLoopSettings = new GUIContent("Tile Light Loop Settings");
4747
public readonly string[] tileLightLoopDebugTileFlagStrings = new string[] { "Punctual Light", "Area Light", "Env Light"};
4848
public readonly GUIContent splitLightEvaluation = new GUIContent("Split light and reflection evaluation", "Toggle");
4949
public readonly GUIContent bigTilePrepass = new GUIContent("Enable big tile prepass", "Toggle");
@@ -52,11 +52,11 @@ private class Styles
5252

5353

5454

55-
public readonly GUIContent textureSettings = new GUIContent("texture Settings");
55+
public readonly GUIContent textureSettings = new GUIContent("Texture Settings");
5656

57-
public readonly GUIContent spotCookieSize = new GUIContent("spotCookie Size");
58-
public readonly GUIContent pointCookieSize = new GUIContent("pointCookie Size");
59-
public readonly GUIContent reflectionCubemapSize = new GUIContent("reflectionCubemap Size");
57+
public readonly GUIContent spotCookieSize = new GUIContent("Spot cookie size");
58+
public readonly GUIContent pointCookieSize = new GUIContent("Point cookie size");
59+
public readonly GUIContent reflectionCubemapSize = new GUIContent("Reflection cubemap size");
6060
}
6161

6262
private static Styles s_Styles = null;
@@ -131,13 +131,8 @@ void FillWithPropertiesEnum(Type type, GUIContent[] debugViewMaterialStrings, in
131131
}
132132
}
133133

134-
public override void OnInspectorGUI()
134+
private void DebugParametersUI(HDRenderLoop renderLoop)
135135
{
136-
var renderLoop = target as HDRenderLoop;
137-
138-
if (!renderLoop)
139-
return;
140-
141136
var debugParameters = renderLoop.debugParameters;
142137

143138
EditorGUILayout.LabelField(styles.debugParameters);
@@ -199,7 +194,10 @@ public override void OnInspectorGUI()
199194
EditorUtility.SetDirty(renderLoop); // Repaint
200195
}
201196
EditorGUI.indentLevel--;
197+
}
202198

199+
private void SkyParametersUI(HDRenderLoop renderLoop)
200+
{
203201
EditorGUILayout.Space();
204202
var skyParameters = renderLoop.skyParameters;
205203

@@ -219,7 +217,10 @@ public override void OnInspectorGUI()
219217
EditorUtility.SetDirty(renderLoop); // Repaint
220218
}
221219
EditorGUI.indentLevel--;
220+
}
222221

222+
private void ShadowParametersUI(HDRenderLoop renderLoop)
223+
{
223224
EditorGUILayout.Space();
224225
var shadowParameters = renderLoop.shadowSettings;
225226

@@ -244,7 +245,10 @@ public override void OnInspectorGUI()
244245
EditorUtility.SetDirty(renderLoop); // Repaint
245246
}
246247
EditorGUI.indentLevel--;
248+
}
247249

250+
private void TextureParametersUI(HDRenderLoop renderLoop)
251+
{
248252
EditorGUILayout.Space();
249253
var textureParameters = renderLoop.textureSettings;
250254

@@ -262,8 +266,10 @@ public override void OnInspectorGUI()
262266
EditorUtility.SetDirty(renderLoop); // Repaint
263267
}
264268
EditorGUI.indentLevel--;
269+
}
265270

266-
271+
private void TilePassUI(HDRenderLoop renderLoop)
272+
{
267273
EditorGUILayout.Space();
268274

269275
// TODO: we should call a virtual method or something similar to setup the UI, inspector should not know about it
@@ -299,5 +305,19 @@ public override void OnInspectorGUI()
299305
EditorGUI.indentLevel--;
300306
}
301307
}
308+
309+
public override void OnInspectorGUI()
310+
{
311+
var renderLoop = target as HDRenderLoop;
312+
313+
if (!renderLoop)
314+
return;
315+
316+
DebugParametersUI(renderLoop);
317+
SkyParametersUI(renderLoop);
318+
ShadowParametersUI(renderLoop);
319+
TextureParametersUI(renderLoop);
320+
TilePassUI(renderLoop);
321+
}
302322
}
303323
}

0 commit comments

Comments
 (0)