コード例 #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;
         }
     }
 }
コード例 #2
0
        protected void TriggerBackwardOccurrences()
        {
            handledOccurrences.Clear();

            while (nextBackwardOccurrence != null && nextBackwardOccurrence.time >= time)
            {
                nextBackwardOccurrence.Backward();

                if (nextBackwardOccurrence.repeatable)
                {
                    handledOccurrences.Add(nextBackwardOccurrence);

                    nextForwardOccurrence = nextBackwardOccurrence;
                }
                else
                {
                    occurrences.Remove(nextBackwardOccurrence);
                }

                nextBackwardOccurrence = OccurrenceBefore(nextBackwardOccurrence.time, handledOccurrences);
            }
        }