Exemple #1
0
 protected virtual void PlaceOccurence(Occurrence occurrence, float time)
 {
     if (time == this.time)
     {
         if (timeScale >= 0)
         {
             occurrence.Forward();
             nextBackwardOccurrence = occurrence;
         }
         else
         {
             occurrence.Backward();
             nextForwardOccurrence = occurrence;
         }
     }
     else if (time > this.time)
     {
         if (nextForwardOccurrence == null ||
             nextForwardOccurrence.time > time)
         {
             nextForwardOccurrence = occurrence;
         }
     }
     else if (time < this.time)
     {
         if (nextBackwardOccurrence == null ||
             nextBackwardOccurrence.time < time)
         {
             nextBackwardOccurrence = occurrence;
         }
     }
 }
Exemple #2
0
        protected void TriggerForwardOccurrences()
        {
            handledOccurrences.Clear();

            while (nextForwardOccurrence != null && nextForwardOccurrence.time <= time)
            {
                nextForwardOccurrence.Forward();

                handledOccurrences.Add(nextForwardOccurrence);

                nextBackwardOccurrence = nextForwardOccurrence;

                nextForwardOccurrence = OccurrenceAfter(nextForwardOccurrence.time, handledOccurrences);
            }
        }