|
|
|
|
|
|
EditorGUILayout.PropertyField(prop, content); |
|
|
|
} |
|
|
|
|
|
|
|
void DrawShadowCascadeBias(int cascadeCount) |
|
|
|
void DrawShadowCascadeBiasOffset(int cascadeCount) |
|
|
|
if (cascadeCount > 0) |
|
|
|
Vector4 cascadeBiasOffset = m_ShadowCascadeBias.vector4Value; |
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
for (int i = 0; i < cascadeCount; ++i) |
|
|
|
EditorGUILayout.PropertyField(m_ShadowCascadeBias, Styles.shadowCascadeBias); |
|
|
|
EditorGUILayout.BeginHorizontal(); |
|
|
|
cascadeBiasOffset[i] = Mathf.Max(0.0f, EditorGUILayout.FloatField(string.Format("Cascade {0} Bias Offset: ", i), cascadeBiasOffset[i])); |
|
|
|
EditorGUILayout.EndHorizontal(); |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
m_ShadowCascadeBias.vector4Value = cascadeBiasOffset; |
|
|
|
} |
|
|
|
|
|
|
|
public override void OnInspectorGUI() |
|
|
|
|
|
|
CoreEditorUtils.DrawPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions); |
|
|
|
|
|
|
|
ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue; |
|
|
|
DrawShadowCascadeBias(m_ShadowCascadesProp.intValue); |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
DrawShadowCascadeBiasOffset(4); |
|
|
|
} |
|
|
|
{ |
|
|
|
DrawShadowCascadeBiasOffset(2); |
|
|
|
} |
|
|
|
|
|
|
|
EditorGUI.indentLevel--; |
|
|
|
|
|
|
|