コード例 #1
0
ファイル: MarkerEditor.cs プロジェクト: 0geova0/Jam
 public bool Equals(MarkerOverlayRegion other)
 {
     return(markerRegion == other.markerRegion &&
            timelineRegion == other.timelineRegion &&
            startTime == other.startTime &&
            endTime == other.endTime);
 }
コード例 #2
0
        void UserOverlaysGUI()
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            if (m_OverlayQueue.Count == 0)
            {
                return;
            }

            // the rect containing the time area plus the time ruler
            var screenRect = new Rect(
                state.sequencerHeaderWidth,
                WindowConstants.timeAreaYPosition,
                position.width - state.sequencerHeaderWidth - (treeView != null && treeView.showingVerticalScrollBar ? WindowConstants.sliderWidth : 0),
                position.height - WindowConstants.timeAreaYPosition - horizontalScrollbarHeight);

            var trackOffset = trackRect.y - screenRect.y;
            var startTime   = state.PixelToTime(screenRect.xMin);
            var endTime     = state.PixelToTime(screenRect.xMax);

            using (new GUIViewportScope(screenRect))
            {
                foreach (var entry in m_OverlayQueue)
                {
                    var uiState = MarkerUIStates.None;
                    if (entry.isCollapsed)
                    {
                        uiState |= MarkerUIStates.Collapsed;
                    }
                    if (entry.isSelected)
                    {
                        uiState |= MarkerUIStates.Selected;
                    }
                    var region = new MarkerOverlayRegion(GUIClip.Clip(entry.rect), screenRect, startTime, endTime, trackOffset);
                    try
                    {
                        entry.editor.DrawOverlay(entry.marker, uiState, region);
                    }
                    catch (Exception e)
                    {
                        Debug.LogException(e);
                    }
                }
            }

            m_OverlayQueue.Clear();
        }
コード例 #3
0
ファイル: MarkerEditor.cs プロジェクト: 0geova0/Jam
 /// <summary>
 /// Draws additional overlays for a marker.
 /// </summary>
 /// <param name="marker">The marker to draw.</param>
 /// <param name="uiState">The visual state of the marker.</param>
 /// <param name="region">The on-screen area where the marker is being drawn.</param>
 /// <remarks>
 /// Notes:
 /// * It is only called during TimelineWindow's Repaint step.
 /// * If there are multiple markers on top of each other, only the topmost marker receives the DrawOverlay call.
 /// </remarks>
 public virtual void DrawOverlay(IMarker marker, MarkerUIStates uiState, MarkerOverlayRegion region)
 {
 }