public void OverlayOnGUI()
        {
            if (!hasSelection)
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            Color oldColor = GUI.color;

            RectangleToolFlags flags = m_CurveEditor.settings.rectangleToolFlags;

            if (flags == RectangleToolFlags.FullRectangleTool)
            {
                GUI.color = Color.white;

                m_HBar.OnGUI(m_Layout.hBarRect);
                m_HBarLeft.OnGUI(m_Layout.hBarLeftRect);
                m_HBarRight.OnGUI(m_Layout.hBarRightRect);

                m_VBar.OnGUI(m_Layout.vBarRect);
                m_VBarBottom.OnGUI(m_Layout.vBarBottomRect);
                m_VBarTop.OnGUI(m_Layout.vBarTopRect);
            }

            DrawLabels();

            GUI.color = oldColor;
        }
Exemple #2
0
        public void OnGUI()
        {
            if (!hasSelection)
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            m_Layout = CalculateLayout();

            m_SelectionBoxes[0].OnGUI(m_Layout.summaryRect);
            m_SelectionBoxes[1].OnGUI(m_Layout.selectionRect);

            bool showRippleHandles = (rippleTime && !isDragging) || (m_RippleTime && isDragging);

            if (showRippleHandles)
            {
                m_SelectionRippleLeft.OnGUI(m_Layout.scaleLeftRect);
                m_SelectionRippleRight.OnGUI(m_Layout.scaleRightRect);
            }
            else
            {
                m_SelectionScaleLeft.OnGUI(m_Layout.scaleLeftRect);
                m_SelectionScaleRight.OnGUI(m_Layout.scaleRightRect);
            }

            DrawLabels();
        }
        public void OnGUI()
        {
            if (!hasSelection)
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            RectangleToolFlags flags = m_CurveEditor.settings.rectangleToolFlags;

            if (flags == RectangleToolFlags.NoRectangleTool)
            {
                return;
            }

            Color oldColor = GUI.color;

            GUI.color = Color.white;

            m_Layout = CalculateLayout();

            if (flags == RectangleToolFlags.FullRectangleTool)
            {
                GUI.Label(m_Layout.selectionLeftRect, GUIContent.none, styles.rectangleToolHighlight);
                GUI.Label(m_Layout.selectionTopRect, GUIContent.none, styles.rectangleToolHighlight);
                GUI.Label(m_Layout.underlayLeftRect, GUIContent.none, styles.rectangleToolHighlight);
                GUI.Label(m_Layout.underlayTopRect, GUIContent.none, styles.rectangleToolHighlight);
            }

            m_SelectionBox.OnGUI(m_Layout.selectionRect);

            m_SelectionScaleTop.OnGUI(m_Layout.scaleTopRect);
            m_SelectionScaleBottom.OnGUI(m_Layout.scaleBottomRect);

            bool showRippleHandles = (rippleTime && dragMode == DragMode.None) || (m_RippleTime && dragMode != DragMode.None);

            if (showRippleHandles)
            {
                m_SelectionRippleLeft.OnGUI(m_Layout.scaleLeftRect);
                m_SelectionRippleRight.OnGUI(m_Layout.scaleRightRect);
            }
            else
            {
                m_SelectionScaleLeft.OnGUI(m_Layout.scaleLeftRect);
                m_SelectionScaleRight.OnGUI(m_Layout.scaleRightRect);
            }

            GUI.color = oldColor;
        }