protected override void OnGUIWindow() { // draw inspector properties GUILayout.BeginVertical(UnityEditorUtility.kOuterContainerStyle); { base.OnGUIWindow(); // disable inspector when its compiling GUI.enabled = !EditorApplication.isCompiling; UnityEditorUtility.DrawSplitter(new Color(0.35f, 0.35f, 0.35f), 1, 10); DrawTopBar(); GUILayout.Space(10f); if (m_activeType == eSettingsType.NONE) { DrawMainMenu(_options: GetAvailableTabs()); } else { DrawDetailedView(); } GUILayout.Space(10f); DrawFooter(); GUILayout.Space(10f); } GUILayout.EndVertical(); // reset GUI state GUI.enabled = true; }
protected override void OnGUIWindow() { // Disable GUI when its compiling GUI.enabled = !EditorApplication.isCompiling; // Drawing tabs GUILayout.BeginVertical(UnityEditorUtility.kOuterContainerStyle); { base.OnGUIWindow(); UnityEditorUtility.DrawSplitter(new Color(0.35f, 0.35f, 0.35f), 1, 10); DrawTopBarButtons(); GUILayout.Space(10f); GUILayout.BeginVertical(UnityEditorUtility.kOuterContainerStyle); { GUILayout.Space(2f); m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition); { DrawTabViews(); } GUILayout.EndScrollView(); GUILayout.Space(2f); } GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); // Change button color, as a feedback to user activity Color _GUIColorOld = GUI.color; GUI.color = EditorPrefs.GetBool(NPSettings.kPrefsKeyPropertyModified) ? Color.red : Color.green; if (GUILayout.Button(m_saveChangesText, GUILayout.MinWidth(120))) { OnPressingSave(); } // Reset back to old state GUI.color = _GUIColorOld; GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); } GUILayout.EndVertical(); // Reset GUI state GUI.enabled = true; }