Пример #1
0
        public override void Overlay(Event evt, WindowState state)
        {
            if (!m_IsCaptured)
            {
                return;
            }

            EditMode.DrawTrimGUI(state, m_TrimClipHandler.clipGUI, m_TrimClipHandler.trimDirection);

            bool trimStart = m_TrimClipHandler.trimDirection == TrimEdge.Start;

            TimeIndicator.Draw(state, trimStart ? m_TrimClipHandler.clipGUI.start : m_TrimClipHandler.clipGUI.end);

            if (m_SnapEngine != null)
            {
                m_SnapEngine.OnGUI(trimStart, !trimStart);
            }

            if (m_OverlayStrings.Count > 0)
            {
                const float stringLengthPadding = 4.0f;
                var         stringLength        = TimelineWindow.styles.tinyFont.CalcSize(
                    new GUIContent(m_OverlayStrings.Aggregate("", (max, cur) => max.Length > cur.Length ? max : cur))
                    ).x + stringLengthPadding;

                var r = new Rect(evt.mousePosition.x - (stringLength / 2.0f),
                                 m_TrimClipHandler.clipGUI.rect.yMax,
                                 stringLength, 20);

                foreach (var s in m_OverlayStrings)
                {
                    GUI.Label(r, s, TimelineWindow.styles.tinyFont);
                }
            }
        }
Пример #2
0
        public override void Overlay(Event evt, WindowState state)
        {
            if (!m_Dragged)
            {
                return;
            }

            if (m_TimeAreaAutoPanner != null)
            {
                m_TimeAreaAutoPanner.OnGUI(evt);
            }

            m_MoveItemHandler.OnGUI(evt);

            if (!m_MoveItemHandler.allowTrackSwitch || m_MoveItemHandler.targetTrack != null)
            {
                TimeIndicator.Draw(state, m_MoveItemHandler.start, m_MoveItemHandler.end);
                m_SnapEngine.OnGUI();
            }
        }