private void DoActiveProfilerButton(Rect position)
{
if (EditorGUI.ButtonMouseDown(position, new GUIContent("Active Profler"), FocusType.Native, EditorStyles.toolbarDropDown))
{
int connectedProfiler = ProfilerDriver.connectedProfiler;
this.connectionGuids = ProfilerDriver.GetAvailableProfilers();
int length = this.connectionGuids.Length;
int[] selected = new int[1];
bool[] enabled = new bool[length];
string[] options = new string[length];
for (int i = 0; i < length; i++)
{
int guid = this.connectionGuids[i];
bool flag = ProfilerDriver.IsIdentifierConnectable(guid);
enabled[i] = flag;
string connectionIdentifier = ProfilerDriver.GetConnectionIdentifier(guid);
if (!flag)
{
connectionIdentifier = connectionIdentifier + " (Version mismatch)";
}
options[i] = connectionIdentifier;
if (guid == connectedProfiler)
{
selected[0] = i;
}
}
EditorUtility.DisplayCustomMenu(position, options, enabled, selected, new EditorUtility.SelectMenuItemFunction(this.SelectProfilerClick), null);
}
}