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; } } }
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); } }