void OnGUI() { EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true)); GUIStyle style = new GUIStyle(GUI.skin.label); style.alignment = TextAnchor.MiddleLeft; GUILayout.Label("Select Thread : ", style); EditorGUILayout.BeginHorizontal(); bool lastEnabled = GUI.enabled; GUI.enabled = m_EnableResetButton; if (GUILayout.Button(Styles.reset, GUILayout.Width(50))) { // Reset the thread window contents only CreateTable(m_ProfileAnalyzerWindow, m_ThreadNames, m_ThreadUINames, m_OriginalThreadSelection); m_EnableApplyButton = true; m_EnableResetButton = false; } GUI.enabled = lastEnabled; if (GUILayout.Button(Styles.clear, GUILayout.Width(50))) { m_ThreadTable.ClearThreadSelection(); } if (GUILayout.Button(Styles.main, GUILayout.Width(100))) { m_ThreadTable.SelectMain(); } if (GUILayout.Button(Styles.common, GUILayout.Width(100))) { m_ThreadTable.SelectCommon(); } GUI.enabled = m_EnableApplyButton && !m_ProfileAnalyzerWindow.IsAnalysisRunning(); EditorGUILayout.Space(); if (GUILayout.Button(Styles.apply, GUILayout.Width(50))) { m_ProfileAnalyzerWindow.SetThreadSelection(m_ThreadTable.GetThreadSelection()); m_EnableApplyButton = false; m_EnableResetButton = true; } GUI.enabled = lastEnabled; EditorGUILayout.EndHorizontal(); if (m_ThreadTable != null) { Rect r = EditorGUILayout.GetControlRect(GUILayout.ExpandHeight(true)); m_ThreadTable.OnGUI(r); } EditorGUILayout.EndVertical(); }
private void OnDestroy() { m_ProfileAnalyzerWindow.SetThreadSelection(m_ThreadTable.GetThreadSelection()); }