private void DrawCPUOrRenderingToolbar(ProfilerProperty property)
{
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
string[] displayedOptions = new string[] { "Hierarchy", "Timeline", "Raw Hierarchy" };
int[] numArray1 = new int[3];
numArray1[1] = 1;
numArray1[2] = 2;
int[] optionValues = numArray1;
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(120f) };
this.m_ViewType = (ProfilerViewType) EditorGUILayout.IntPopup((int) this.m_ViewType, displayedOptions, optionValues, EditorStyles.toolbarDropDown, options);
GUILayout.FlexibleSpace();
GUILayout.Label(string.Format("CPU:{0}ms GPU:{1}ms", property.frameTime, property.frameGpuTime), EditorStyles.miniLabel, new GUILayoutOption[0]);
GUI.enabled = ProfilerDriver.GetNextFrameIndex(this.m_CurrentFrame) == -1;
if (GUILayout.Button(!GUI.enabled ? ms_Styles.noFrameDebugger : ms_Styles.frameDebugger, EditorStyles.toolbarButton, new GUILayoutOption[0]))
{
FrameDebuggerWindow.ShowFrameDebuggerWindow().EnableIfNeeded();
}
GUI.enabled = true;
if (ProfilerInstrumentationPopup.InstrumentationEnabled && GUILayout.Button(ms_Styles.profilerInstrumentation, EditorStyles.toolbarDropDown, new GUILayoutOption[0]))
{
ProfilerInstrumentationPopup.Show(GUILayoutUtility.topLevel.GetLast());
}
GUILayout.FlexibleSpace();
if (this.m_ViewType == ProfilerViewType.Timeline)
{
this.m_TimelineViewDetail = GUILayout.Toggle(this.m_TimelineViewDetail, ms_Styles.timelineHighDetail, EditorStyles.toolbarButton, new GUILayoutOption[0]);
ms_Styles.memRecord.text = "Mem Record";
if (this.m_SelectedMemRecordMode != ProfilerMemoryRecordMode.None)
{
string text = ms_Styles.memRecord.text;
object[] objArray1 = new object[] { text, " [", this.s_CheckMark, "]" };
ms_Styles.memRecord.text = string.Concat(objArray1);
}
GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(100f) };
Rect position = GUILayoutUtility.GetRect(ms_Styles.memRecord, EditorStyles.toolbarDropDown, optionArray2);
if (EditorGUI.ButtonMouseDown(position, ms_Styles.memRecord, FocusType.Passive, EditorStyles.toolbarDropDown))
{
string[] strArray2 = new string[] { "None", "Sample only", "Callstack (fast)", "Callstack (full)" };
bool[] enabled = new bool[strArray2.Length];
for (int i = 0; i < strArray2.Length; i++)
{
enabled[i] = true;
}
int[] selected = new int[] { this.m_SelectedMemRecordMode };
EditorUtility.DisplayCustomMenu(position, strArray2, enabled, selected, new EditorUtility.SelectMenuItemFunction(this.MemRecordModeClick), null);
}
}
else
{
this.SearchFieldGUI();
}
EditorGUILayout.EndHorizontal();
this.HandleCommandEvents();
}