Class TimelineTrack
A lane inside a Timeline, holding TimelineClips and TimelineKeyframes.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelineTrack : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The track's label is not drawn by the track itself — the Timeline's left gutter renders it, so labels stay put while the lanes pan. Set color to give every clip and keyframe in the lane a default fill; each of them can still override it.
Examples
<appui:TimelineTrack id="position" label="Position">
<appui:TimelineClip start="4" duration="12" label="Walk" />
</appui:TimelineTrack>
Constructors
TimelineTrack()
Default constructor.
Declaration
public TimelineTrack()
Fields
backgroundUssClassName
The styling class of the lane background that spans the duration.
Declaration
public const string backgroundUssClassName = "appui-timeline__track-background"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The TimelineTrack main styling class.
Declaration
public const string ussClassName = "appui-timeline__track"
Field Value
| Type | Description |
|---|---|
| string |
Properties
color
The default fill for the clips and keyframes in this lane.
Declaration
[Tooltip("The default fill for the clips and keyframes in this lane.")]
[CreateProperty]
[UxmlAttribute]
public Optional<Color> color { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<Color> |
height
The lane height in pixels. A negative value, the default, defers to the Timeline's trackHeight.
Declaration
[Tooltip("The lane height in pixels. Negative defers to the Timeline's trackHeight.")]
[CreateProperty]
[UxmlAttribute]
public float height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
id
A stable identifier for the lane.
Declaration
[Tooltip("A stable identifier for the lane.")]
[CreateProperty]
[UxmlAttribute]
public string id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
label
The text the Timeline's gutter shows for this lane.
Declaration
[Tooltip("The text the Timeline's gutter shows for this lane.")]
[CreateProperty]
[UxmlAttribute]
public string label { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
lane
Whether the translucent lane is drawn behind the track. Turn it off for a heading row that holds no clips or keys, so only lanes with content read as lanes. True by default.
Declaration
[Tooltip("Whether the lane is drawn behind the track.")]
[CreateProperty]
[UxmlAttribute]
public bool lane { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
laneElement
The lane drawn behind the track. Style it, a rim on its ends for instance, through USS.
Declaration
public VisualElement laneElement { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
laneEnd
Where the lane ends, in time units: the extent of what the track holds, a clip's span for instance. Negative, the default, ends it at the Timeline's laneExtent.
Declaration
[Tooltip("Where the lane ends, in time units. Negative ends it at the Timeline's laneExtent.")]
[CreateProperty]
[UxmlAttribute]
public float laneEnd { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
laneStart
Where the lane begins, in time units. Zero by default.
Declaration
[Tooltip("Where the lane begins, in time units.")]
[CreateProperty]
[UxmlAttribute]
public float laneStart { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
resolvedHeight
The height this lane actually renders at, resolving the Timeline's default.
Declaration
public float resolvedHeight { get; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
OnAxisChanged()
Re-project this part onto the current axis.
Declaration
protected override void OnAxisChanged()
Overrides
Remarks
Called on attach and on every axis change — a scale, zoom, pan, playhead, tick or
selection change. Guard against a null axis.