Class TimelinePart
Base class for the parts that live on a Timeline's time axis.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public abstract class TimelinePart : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
A part reads the axis from the TimelineAxisContext its Timeline provides rather than reaching for its parent, so it keeps working however deeply it is nested — inside a track, inside a group, inside another wrapper. OnAxisChanged() is called once on attach and again on every axis change; override it and project through axis.
Constructors
TimelinePart()
Default constructor.
Declaration
protected TimelinePart()
Properties
axis
The current axis, or null while the part is not inside a Timeline.
Declaration
protected TimelineAxisContext axis { get; }
Property Value
| Type | Description |
|---|---|
| TimelineAxisContext |
timeline
The Timeline this part belongs to, or null.
Declaration
public Timeline timeline { get; }
Property Value
| Type | Description |
|---|---|
| Timeline |
Methods
OnAxisChanged()
Re-project this part onto the current axis.
Declaration
protected abstract void OnAxisChanged()
Remarks
Called on attach and on every axis change — a scale, zoom, pan, playhead, tick or
selection change. Guard against a null axis.
TimeToX(float)
Project a time onto an x coordinate inside the strip.
Declaration
protected float TimeToX(float t)
Parameters
| Type | Name | Description |
|---|---|---|
| float | t | The time, in time units. |
Returns
| Type | Description |
|---|---|
| float | The x coordinate in pixels, or 0 when there is no axis yet. |