private void CommandBufferGUI()
{
if (this.targets.Length != 1)
{
return;
}
Camera target = this.target as Camera;
if ((UnityEngine.Object)target == (UnityEngine.Object)null)
{
return;
}
int commandBufferCount = target.commandBufferCount;
if (commandBufferCount == 0)
{
return;
}
this.m_CommandBuffersShown = GUILayout.Toggle(this.m_CommandBuffersShown, GUIContent.Temp(commandBufferCount.ToString() + " command buffers"), EditorStyles.foldout, new GUILayoutOption[0]);
if (!this.m_CommandBuffersShown)
{
return;
}
++EditorGUI.indentLevel;
foreach (CameraEvent evt in (CameraEvent[])Enum.GetValues(typeof(CameraEvent)))
{
foreach (CommandBuffer commandBuffer in target.GetCommandBuffers(evt))
{
using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
{
Rect rect = GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.miniLabel);
rect.xMin += EditorGUI.indent;
Rect removeButtonRect = CameraEditor.GetRemoveButtonRect(rect);
rect.xMax = removeButtonRect.x;
GUI.Label(rect, string.Format("{0}: {1} ({2})", (object)evt, (object)commandBuffer.name, (object)EditorUtility.FormatBytes(commandBuffer.sizeInBytes)), EditorStyles.miniLabel);
if (GUI.Button(removeButtonRect, CameraEditor.Styles.iconRemove, CameraEditor.Styles.invisibleButton))
{
target.RemoveCommandBuffer(evt, commandBuffer);
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;
}