Timeline<T>
Timeline<T>
Properties
bool isEmpty { get; }
True if the timeline is empty.
bool isNotEmpty { get; }
True if the timeline has values.
Methods
void Clear()
Clear the timeline.
bool IsTimeInsideTimeline(double time)
True if the time is inside the span of the timeline and can be interpolated.
bool IsTimeAheadTimeline(double time)
True if the time is newer than the newer frame in the timeline (or the timeline is empty).
bool IsTimeBehindTimeline(double time)
True if the time is older than the oldest frame in the timeline (or the timeline is empty).
double GetNewestTime()
Get the newest timestamp in the timeline. This value is cached for quick access.
T GetNewestValue()
Get the newest value in the timeline.
T GetValueAtIndex(int index)
Get a value by index. The newest value is indexed at 0, the oldest value is indexed at `count - 1`.
double GetOldestTime()
Get the oldest timestamp in the timeline. This value is cached for quick access.
T GetOldestValue()
Get the oldest value in the timeline.
void Add(double time, T value)
Add a snapshot to the front of the timeline.
T Get(double time)
Get an interpolated position/rotation/scale within the timeline. If the input time is outside the timeline, this returns the snapshot closest to the timestamp.