Пример #1
0
        public override void Draw(Rect rect)
        {
            EditorGUI.BeginChangeCheck();
            m_state = GUIControls.Toggle(rect, m_state, m_label);

            if (EditorGUI.EndChangeCheck())
            {
                if (m_state)
                {
                    GetWindow().Show();
                }
                else
                {
                    GetWindow().Close();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Handle the GUI drawing.
        /// </summary>
        protected void OnGUI()
        {
            EditorGUI.BeginChangeCheck();
            m_index = GUIControls.ToggleGroup(m_index, m_labels);

            if (EditorGUI.EndChangeCheck())
            {
                if (m_index > -1)
                {
                    UnregisterTool();
                    RegisterTool(m_tools [m_index]);
                }
                else
                {
                    UnregisterTool();
                }
            }

            if (m_activeTool != null)
            {
                m_activeTool.OnGUI();
            }
        }