private void OnGUI()
{
GUI.Label(new Rect(0f, 0f, base.position.width, 20f), "Heapshots are located here: " + Path.Combine(Application.dataPath, "Heapshots"));
GUI.Label(new Rect(0f, 20f, base.position.width, 20f), "Currently opened: " + this.lastOpenedHeapshotFile);
GUI.Label(new Rect(100f, 40f, base.position.width, 20f), "Profiling: " + this.lastOpenedProfiler);
this.DoActiveProfilerButton(new Rect(0f, 40f, 100f, 30f));
if (GUI.Button(new Rect(0f, 70f, 200f, 20f), "CaptureHeapShot", EditorStyles.toolbarDropDown))
{
ProfilerDriver.CaptureHeapshot();
}
GUI.changed = false;
this.selectedHeapshot = EditorGUI.Popup(new Rect(250f, 70f, 500f, 30f), "Click to open -->", this.selectedHeapshot, this.heapshotFiles.ToArray());
if (GUI.changed && (this.heapshotFiles[this.selectedHeapshot].Length > 0))
{
this.OpenHeapshot(this.heapshotFiles[this.selectedHeapshot] + ".heapshot");
}
GUILayout.BeginArea(new Rect(0f, 90f, base.position.width, 60f));
SplitterGUILayout.BeginHorizontalSplit(this.viewSplit, new GUILayoutOption[0]);
GUILayout.BeginVertical(new GUILayoutOption[0]);
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
string[] strArray = new string[] { "Roots", "All Objects" };
for (int i = 0; i < strArray.Length; i++)
{
GUILayoutOption[] optionArray1 = new GUILayoutOption[] { GUILayout.MaxHeight(16f) };
if (GUILayout.Toggle(this.currentTab == i, strArray[i], EditorStyles.toolbarButton, optionArray1))
{
this.currentTab = i;
}
}
GUILayout.EndHorizontal();
this.DoTitles(this.titleSplit1);
GUILayout.EndVertical();
GUILayout.BeginVertical(new GUILayoutOption[0]);
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MaxHeight(16f) };
GUILayout.Label("Back trace references", EditorStyles.toolbarButton, options);
this.DoTitles(this.titleSplit2);
GUILayout.EndVertical();
SplitterGUILayout.EndHorizontalSplit();
GUILayout.EndArea();
this.guiRect = new Rect(0f, 130f, (float) this.viewSplit.realSizes[0], 16f);
float height = this.GetItemCount(this.hsAllObjects) * 16f;
Rect position = new Rect(this.guiRect.x, this.guiRect.y, this.guiRect.width, base.position.height - this.guiRect.y);
this.leftViewScrollPosition = GUI.BeginScrollView(position, this.leftViewScrollPosition, new Rect(0f, 0f, position.width - 20f, height));
this.itemIndex = 0;
this.guiRect.y = 0f;
switch (this.currentTab)
{
case 0:
this.DoHeapshotObjects(this.hsRoots, this.titleSplit1, 0, new OnSelect(this.OnSelectObject));
break;
case 1:
this.DoHeapshotObjects(this.hsAllObjects, this.titleSplit1, 0, new OnSelect(this.OnSelectObject));
break;
}
GUI.EndScrollView();
this.guiRect = new Rect((float) this.viewSplit.realSizes[0], 130f, (float) this.viewSplit.realSizes[1], 16f);
float num3 = this.GetItemCount(this.hsBackTraceObjects) * 16f;
position = new Rect(this.guiRect.x, this.guiRect.y, this.guiRect.width, base.position.height - this.guiRect.y);
this.rightViewScrollPosition = GUI.BeginScrollView(position, this.rightViewScrollPosition, new Rect(0f, 0f, position.width - 20f, num3));
if (this.hsBackTraceObjects.Count > 0)
{
this.guiRect.y = 0f;
this.itemIndex = 0;
this.DoHeapshotObjects(this.hsBackTraceObjects, this.titleSplit2, 0, null);
}
GUI.EndScrollView();
}