Class TimelineKeyframe
A point keyframe on a TimelineTrack.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelineKeyframe : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The glyph is centred on its time — a diamond by default, matching the animation editors. Turn on draggable to let the user re-time it; the new time is committed once on release through moved, snapped to the Timeline's step.
Constructors
TimelineKeyframe()
Default constructor.
Declaration
public TimelineKeyframe()
Fields
glyphUssClassName
The styling class of the glyph inside the keyframe's hit target.
Declaration
public const string glyphUssClassName = "appui-timeline__keyframe-glyph"
Field Value
| Type | Description |
|---|---|
| string |
mutedUssClassName
The styling class applied while the keyframe is muted.
Declaration
public const string mutedUssClassName = "appui-timeline__keyframe--muted"
Field Value
| Type | Description |
|---|---|
| string |
smallUssClassName
The styling class applied while the keyframe draws its small glyph.
Declaration
public const string smallUssClassName = "appui-timeline__keyframe--size-small"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The TimelineKeyframe main styling class.
Declaration
public const string ussClassName = "appui-timeline__keyframe"
Field Value
| Type | Description |
|---|---|
| string |
Properties
color
The glyph fill. Unset falls back to the track colour, then to the stylesheet.
Declaration
[Tooltip("The glyph fill. Unset falls back to the track colour.")]
[CreateProperty]
[UxmlAttribute]
public Optional<Color> color { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<Color> |
draggable
Whether dragging re-times the keyframe.
Declaration
[Tooltip("Whether dragging re-times the keyframe.")]
[CreateProperty]
[UxmlAttribute]
public bool draggable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
id
A stable identifier for the keyframe.
Declaration
[Tooltip("A stable identifier for the keyframe.")]
[CreateProperty]
[UxmlAttribute]
public string id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
muted
Whether the keyframe is dimmed to a smaller, quieter marker.
Declaration
[Tooltip("Whether the keyframe is dimmed to a smaller, quieter marker.")]
[CreateProperty]
[UxmlAttribute]
public bool muted { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
For a key that exists but is not in play -- a muted track's, or one on a layer the editor is not currently soloing. It stays pickable: muted is about emphasis, not interactivity.
resolvedSize
The size the glyph actually draws at, after deferring to the Timeline and to muted.
Declaration
public TimelineKeySize resolvedSize { get; }
Property Value
| Type | Description |
|---|---|
| TimelineKeySize |
selected
Whether the keyframe draws its selected outline.
Declaration
[Tooltip("Whether the keyframe draws its selected outline.")]
[CreateProperty]
[UxmlAttribute]
public bool selected { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
shape
The glyph shape.
Declaration
[Tooltip("The glyph shape.")]
[CreateProperty]
[UxmlAttribute]
public TimelineKeyframeShape shape { get; set; }
Property Value
| Type | Description |
|---|---|
| TimelineKeyframeShape |
size
The glyph size. Auto, the default, defers to the Timeline's keySize, then to small for a muted key and regular otherwise.
Declaration
[Tooltip("The glyph size. Auto defers to the Timeline's keySize, then to small when muted.")]
[CreateProperty]
[UxmlAttribute]
public TimelineKeySize size { get; set; }
Property Value
| Type | Description |
|---|---|
| TimelineKeySize |
time
The keyframe's position on the time axis, in time units.
Declaration
[Tooltip("The keyframe's position on the time axis, in time units.")]
[CreateProperty]
[UxmlAttribute]
public float time { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
GetShapeUssClassName(TimelineKeyframeShape)
Declaration
public static string GetShapeUssClassName(TimelineKeyframeShape enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineKeyframeShape | enumValue |
Returns
| Type | Description |
|---|---|
| string |
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.
Events
clicked
Raised when the keyframe is clicked without dragging.
Declaration
public event Action clicked
Event Type
| Type | Description |
|---|---|
| Action |
moved
Raised once on release with the committed time.
Declaration
public event Action<float> moved
Event Type
| Type | Description |
|---|---|
| Action<float> |