private void CommandBufferGUI()
{
if (base.targets.Length == 1)
{
Light target = base.target as Light;
if (target != null)
{
int commandBufferCount = target.commandBufferCount;
if (commandBufferCount != 0)
{
this.m_CommandBuffersShown = GUILayout.Toggle(this.m_CommandBuffersShown, GUIContent.Temp(commandBufferCount + " command buffers"), EditorStyles.foldout, new GUILayoutOption[0]);
if (this.m_CommandBuffersShown)
{
EditorGUI.indentLevel++;
foreach (LightEvent event2 in (LightEvent[]) Enum.GetValues(typeof(LightEvent)))
{
CommandBuffer[] commandBuffers = target.GetCommandBuffers(event2);
foreach (CommandBuffer buffer in commandBuffers)
{
using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
{
Rect r = GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.miniLabel);
r.xMin += EditorGUI.indent;
Rect removeButtonRect = GetRemoveButtonRect(r);
r.xMax = removeButtonRect.x;
GUI.Label(r, string.Format("{0}: {1} ({2})", event2, buffer.name, EditorUtility.FormatBytes(buffer.sizeInBytes)), EditorStyles.miniLabel);
if (GUI.Button(removeButtonRect, s_Styles.iconRemove, s_Styles.invisibleButton))
{
target.RemoveCommandBuffer(event2, buffer);
SceneView.RepaintAll();
GameView.RepaintAll();
GUIUtility.ExitGUI();
}
}
}
}
using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
{
GUILayout.FlexibleSpace();
if (GUILayout.Button("Remove all", EditorStyles.miniButton, new GUILayoutOption[0]))
{
target.RemoveAllCommandBuffers();
SceneView.RepaintAll();
GameView.RepaintAll();
}
}
EditorGUI.indentLevel--;
}
}
}
}
}