コード例 #1
0
        private void ShowMenu()
        {
            EditorGUI.BeginDisabledGroup(!Application.isPlaying);
            EditorGUILayout.BeginHorizontal();

            string collapseButtonTitle = m_IsHidden ? "Expand" : "Collapse";

            if (GUILayout.Button(collapseButtonTitle, ObserverStyles.MenuButton))
            {
                m_IsHidden = !m_IsHidden;
                Observer.ToggleCategories(m_IsHidden);
            }

            GUI.backgroundColor = m_IsPaused ? ObserverStyles.YellowColor : ObserverStyles.DefaultColor;
            if (GUILayout.Button("Pause", ObserverStyles.MenuButton))
            {
                m_IsPaused = !m_IsPaused;
            }

            GUI.backgroundColor = ObserverStyles.RedColor;
            if (GUILayout.Button("Clear", ObserverStyles.MenuButton))
            {
                Observer.ClearAll();
                Repaint();
            }

            GUI.backgroundColor = ObserverStyles.DefaultColor;
            EditorGUILayout.EndHorizontal();
            EditorGUI.EndDisabledGroup();
        }