Example #1
0
        public TimelineBase GetTimelineAtFrame(int frameNumber)
        {
            if (timelines != null)
            {
                TimelineBase timeline = timelines[lastestTimelineIndex];
                if (frameNumber > lastestFrame)
                {
                    while (frameNumber >= timeline.EndFrame &&
                           lastestTimelineIndex < timelines.Count - 1)
                    {
                        lastestTimelineIndex++;
                        timeline = timelines[lastestTimelineIndex];
                    }
                    lastestFrame = frameNumber;
                    return(timeline);
                }
                else
                {
                    while (frameNumber < timeline.StartFrame &&
                           lastestTimelineIndex > 0)
                    {
                        lastestTimelineIndex--;
                        timeline = timelines[lastestTimelineIndex];
                    }
                    lastestFrame = frameNumber;
                    return(timeline);
                }
            }

            return(null);
        }
Example #2
0
 protected void InnerAdd(TimelineBase timeline)
 {
     if (timelines == null)
     {
         timelines = new List <TimelineBase>();
     }
     timelines.Add(timeline);
 }
Example #3
0
 protected void InnerAppendLast(TimelineBase timeline)
 {
     if (timelines == null)
     {
         timelines = new List <TimelineBase>();
     }
     if (timelines.Count > 0)
     {
         timeline.StartFrame = timelines[timelines.Count - 1].EndFrame + 1;
         timelines.Add(timeline);
     }
     else
     {
         timeline.StartFrame = 0;
         timelines.Add(timeline);
     }
 }