Ejemplo n.º 1
0
 private void DrawExtrapolation(Rect trackRect, Rect clipRect)
 {
     if (this.clip.hasPreExtrapolation)
     {
         GUIStyle extrapolationIcon = this.GetExtrapolationIcon(this.clip.preExtrapolationMode);
         if (extrapolationIcon != null)
         {
             Rect preExtrapolationBounds = this.GetPreExtrapolationBounds(trackRect, clipRect, extrapolationIcon);
             if (preExtrapolationBounds.get_width() > 1f && preExtrapolationBounds.get_height() > 1f)
             {
                 TimelineClipGUI.DrawExtrapolationIcon(preExtrapolationBounds, extrapolationIcon);
             }
         }
     }
     if (this.clip.hasPostExtrapolation)
     {
         GUIStyle extrapolationIcon2 = this.GetExtrapolationIcon(this.clip.postExtrapolationMode);
         if (extrapolationIcon2 != null)
         {
             Rect postExtrapolationBounds = this.GetPostExtrapolationBounds(trackRect, clipRect, extrapolationIcon2);
             if (postExtrapolationBounds.get_width() > 1f && postExtrapolationBounds.get_height() > 1f)
             {
                 TimelineClipGUI.DrawExtrapolationIcon(postExtrapolationBounds, extrapolationIcon2);
             }
         }
     }
 }
 public void Add(TimelineClipGUI clip)
 {
     this.m_Members.Add(clip);
     if (this.m_Members.Count == 1)
     {
         this.m_BoundingRect = clip.clippedRect;
     }
     else
     {
         this.m_BoundingRect = RectUtils.Encompass(this.m_BoundingRect, clip.bounds);
     }
 }
Ejemplo n.º 3
0
 private void DrawCurveEditorsForClipsOnTrack(Rect headerRect, Rect trackRect, TimelineWindow.TimelineState state)
 {
     if (this.m_TrackGUI.clips.Count != 0)
     {
         if (Event.get_current().get_type() == 8)
         {
             TimelineClipGUI timelineClipGUI = SelectionManager.SelectedClipGUI().FirstOrDefault((TimelineClipGUI x) => x.parentTrackGUI == this.m_TrackGUI);
             if (timelineClipGUI != null && timelineClipGUI != this.m_LastSelectedClipGUI)
             {
                 this.m_LastSelectedClipGUI = timelineClipGUI;
             }
             if (this.m_LastSelectedClipGUI == null)
             {
                 this.m_LastSelectedClipGUI = this.m_TrackGUI.clips[0];
             }
         }
         if (this.m_LastSelectedClipGUI != null && this.m_LastSelectedClipGUI.clipCurveEditor != null)
         {
             Rect rect = this.m_LastSelectedClipGUI.rect;
             InlineCurveEditor.DrawCurveEditor(this.m_LastSelectedClipGUI, state, headerRect, trackRect, new Vector2(rect.get_xMin(), rect.get_xMax()), this.m_TrackGUI.locked);
         }
     }
 }
Ejemplo n.º 4
0
 public void CalculateLoopRects(Rect trackRect, TimelineWindow.TimelineState state, int currentClipHash)
 {
     if (this.clip.duration >= TimelineWindow.TimelineState.kTimeEpsilon)
     {
         if (this.clip.dirtyHash != currentClipHash)
         {
             float num = 0f;
             this.m_LoopRects.Clear();
             double[] loopTimes    = TimelineHelpers.GetLoopTimes(this.clip);
             double   loopDuration = TimelineHelpers.GetLoopDuration(this.clip);
             this.m_MinLoopIndex = 0;
             if (!this.supportsLooping)
             {
                 if (loopTimes.Length > 1)
                 {
                     double num2 = loopTimes[1];
                     float  num3 = (float)(this.clip.duration - num2);
                     this.m_LoopRects.Add(TimelineClipGUI.ProjectRectOnTimeline(new Rect((float)(num2 + this.clip.start), 0f, num3, 0f), trackRect, state));
                 }
             }
             else
             {
                 int num4 = Array.BinarySearch <double>(loopTimes, (double)state.PixelToTime(trackRect.get_xMin()));
                 int num5 = Array.BinarySearch <double>(loopTimes, (double)state.PixelToTime(trackRect.get_xMax()));
                 num4 = ((num4 < 0) ? Math.Max(1, ~num4 - 2) : num4);
                 num5 = ((num5 < 0) ? Math.Max(1, ~num5) : num5);
                 this.m_MinLoopIndex = num4;
                 int num6 = num5 - num4;
                 if ((float)num6 * 4f < trackRect.get_width())
                 {
                     for (int i = num4; i < num5; i++)
                     {
                         double num7 = loopTimes[i];
                         float  num8 = Mathf.Min((float)(this.clip.duration - num7), (float)loopDuration);
                         Rect   item = TimelineClipGUI.ProjectRectOnTimeline(new Rect((float)(num7 + this.clip.start), 0f, num8, 0f), trackRect, state);
                         if (item.get_xMin() > trackRect.get_xMax())
                         {
                             break;
                         }
                         if (item.get_xMax() >= trackRect.get_xMin())
                         {
                             this.m_LoopRects.Add(item);
                             num += item.get_width();
                         }
                         else
                         {
                             this.m_MinLoopIndex++;
                         }
                     }
                     if ((float)this.m_LoopRects.Count * 4f >= trackRect.get_width())
                     {
                         this.m_LoopRects.Clear();
                     }
                     if (num < 2f)
                     {
                         this.m_LoopRects.Clear();
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
 public TimelineClipHandle(TimelineClipGUI theClip, TimelineClipHandle.DragDirection direction, DragClipHandle clipHandleManipulator)
 {
     this.m_Direction = direction;
     this.m_Clip      = theClip;
     base.AddManipulator(clipHandleManipulator);
 }
 public TimelineBlendHandle(TimelineClipGUI theClip, TimelineBlendHandle.DragDirection direction)
 {
     this.direction = direction;
     this.clip      = theClip;
     this.m_Styles  = DirectorStyles.Instance;
 }