Esempio n. 1
0
        public static IEnumerable <TimelineItemGUI> SelectedItemGUI()
        {
            IEnumerable <TimelineItemGUI> first  = SelectionManager.SelectedClipGUI().Cast <TimelineItemGUI>();
            IEnumerable <TimelineItemGUI> second = SelectionManager.SelectedMarkerGUI().Cast <TimelineItemGUI>();

            return(first.Union(second));
        }
 public override void Init(IControl parent)
 {
     parent.ContextClick += delegate(object target, Event evt, TimelineWindow.TimelineState state)
     {
         IEnumerable <TimelineMarkerGUI> source = SelectionManager.SelectedMarkerGUI();
         bool result;
         if (!source.Any <TimelineMarkerGUI>())
         {
             result = base.IgnoreEvent();
         }
         else if (!source.Any((TimelineMarkerGUI c) => c.bounds.Contains(evt.get_mousePosition())))
         {
             result = base.IgnoreEvent();
         }
         else
         {
             TimelineMarkerGUI timelineMarkerGUI = target as TimelineMarkerGUI;
             SequencerContextMenu.Show(timelineMarkerGUI.parentTrackGUI.drawer, evt.get_mousePosition());
             result = base.ConsumeEvent();
         }
         return(result);
     };
 }
Esempio n. 3
0
        public override void Draw(Rect headerRect, Rect trackRect, TimelineWindow.TimelineState state, float identWidth)
        {
            if (base.track.GetShowInlineCurves() && this.inlineCurveEditor == null)
            {
                this.inlineCurveEditor = new InlineCurveEditor(this);
            }
            this.UpdateInfiniteClipEditor(base.track as AnimationTrack, state.GetWindow());
            Rect  trackRect2 = trackRect;
            float num        = this.InlineAnimationCurveHeight();

            trackRect.set_height(trackRect.get_height() - num);
            if (Event.get_current().get_type() == 7)
            {
                this.m_TrackRect = trackRect;
                state.quadTree.Insert(this);
                int num2 = this.BlendHash();
                if (this.m_BlendHash != num2)
                {
                    this.UpdateClipOverlaps();
                    this.m_BlendHash = num2;
                }
                base.isDropTarget = false;
            }
            if (TimelineTrackGUI.s_ArmForRecordContentOn == null)
            {
                TimelineTrackGUI.s_ArmForRecordContentOn = new GUIContent(TimelineWindow.styles.autoKey.get_active().get_background());
            }
            if (TimelineTrackGUI.s_ArmForRecordContentOff == null)
            {
                TimelineTrackGUI.s_ArmForRecordContentOff = new GUIContent(TimelineWindow.styles.autoKey.get_normal().get_background());
            }
            base.track.SetCollapsed(!base.isExpanded);
            headerRect.set_width(headerRect.get_width() - 2f);
            if (this.m_TrackHash != base.track.Hash())
            {
                this.RebuildGUICache(state);
            }
            bool    flag = false;
            Vector2 timeAreaShownRange = state.timeAreaShownRange;

            if (base.drawer != null)
            {
                flag = base.drawer.DrawTrack(trackRect, base.track, timeAreaShownRange, state);
            }
            if (!flag)
            {
                using (new GUIViewportScope(trackRect))
                {
                    this.DrawBackground(trackRect, state);
                    if (this.resortClips)
                    {
                        int num3 = 0;
                        this.SortClipsByStartTime();
                        this.ResetClipParityID();
                        foreach (TimelineClipGUI current in this.m_ClipGUICache)
                        {
                            current.parityID = this.GetNextClipParityID();
                            current.zOrder   = num3++;
                            if (SelectionManager.Contains(current.clip))
                            {
                                current.zOrder += 1000;
                            }
                        }
                        IEnumerable <TimelineClipGUI> selectedClips = SelectionManager.SelectedClipGUI();
                        this.m_ClipGUICache = (from x in this.m_ClipGUICache
                                               orderby selectedClips.Contains(x), x.clip.start
                                               select x).ToList <TimelineClipGUI>();
                        this.resortClips = false;
                    }
                    if (this.resortEvents)
                    {
                        int num4 = 0;
                        this.SortEventsByStartTime();
                        foreach (TimelineMarkerGUI current2 in this.m_MarkerGuiCache)
                        {
                            current2.zOrder = num4++;
                            if (SelectionManager.Contains(current2.timelineMarker))
                            {
                                current2.zOrder += 1000;
                            }
                        }
                        IEnumerable <TimelineMarkerGUI> selectedMarkers = SelectionManager.SelectedMarkerGUI();
                        this.m_MarkerGuiCache = (from x in this.m_MarkerGuiCache
                                                 orderby selectedMarkers.Contains(x), x.timelineMarker.time
                                                 select x).ToList <TimelineMarkerGUI>();
                        this.resortEvents = false;
                    }
                    this.DrawClips(trackRect, state);
                    this.DrawEvents(trackRect, state);
                    this.DrawClipConnectors();
                }
                if (this.m_InfiniteTrackDrawer != null)
                {
                    this.m_InfiniteTrackDrawer.DrawTrack(trackRect, base.track, timeAreaShownRange, state);
                }
            }
            this.DrawTrackHeader(headerRect, state, identWidth, num);
            this.DrawInlineCurves(headerRect, trackRect2, state, identWidth, num);
            this.DrawMuteState(trackRect, state);
            this.DrawLockState(trackRect, state);
        }