Class TrackAsset
A PlayableAsset representing a track inside a timeline.
Inherited Members
Namespace: UnityEngine.Timeline
Assembly: solution.dll
Syntax
[Serializable]
public abstract class TrackAsset : PlayableAsset, IPlayableAsset, IPropertyPreview, ISerializationCallbackReceiver
Remarks
Derive from TrackAsset to implement custom timeline tracks. TrackAsset derived classes support the following attributes:
HideInMenuAttribute TrackColorAttribute TrackClipTypeAttribute TrackBindingTypeAttribute DisplayNameAttribute
Examples
using UnityEngine;
using UnityEngine.Timeline;
[DisplayName("Custom Lighting Track")]
[TrackColor(1,0,0)]
[TrackBindingType(typeof(Light))]
[TrackClipType(typeof(PointLightClip))]
[TrackClipType(typeof(SpotLightClip))]
public class LightTrack : TrackAsset
{
}
Fields
| Name | Description |
|---|---|
| m_Clips |
Properties
| Name | Description |
|---|---|
| curves | An animation clip storing animated properties of the attached PlayableAsset |
| duration | The length, in seconds, of this track |
| end | The end time, in seconds, of this track |
| hasClips | Whether this track contains any TimelineClip. |
| hasCurves | Whether this track contains animated properties for the attached PlayableAsset. |
| isEmpty | Whether this track is considered empty. |
| isSubTrack | Returns whether this track is a subtrack |
| locked | The local locked state of the track. |
| lockedInHierarchy | The locked state of a track. (RO) |
| muted | Whether the track is muted or not. |
| mutedInHierarchy | The muted state of a track. |
| outputs | Returns a description of the PlayableOutputs that will be created by this track. |
| parent | The owner of this track. |
| start | The start time, in seconds, of this track |
| supportsNotifications | Indicates if a track accepts markers that implement INotification. |
| timelineAsset | The TimelineAsset that this track belongs to. |
Methods
| Name | Description |
|---|---|
| CalculateItemsHash() | |
| CreateClip<T>() | Creates a clip on the track with a playable asset attached, whose derived type is specified by T |
| CreateCurves(string) | Creates an AnimationClip to store animated properties for the attached PlayableAsset. |
| CreateDefaultClip() | Creates a TimelineClip on this track. |
| CreateMarker(Type, double) | Creates a marker of the requested type, at a specific time, and adds the marker to the current asset. |
| CreateMarker<T>(double) | Creates a marker of the requested type, at a specific time, and adds the marker to the current asset. |
| CreatePlayable(PlayableGraph, GameObject) | Overrides PlayableAsset.CreatePlayable(). Not used in Timeline. |
| CreatePlayable(PlayableGraph, GameObject, TimelineClip) | Constructs a Playable from a TimelineClip. |
| CreateTrackMixer(PlayableGraph, GameObject, int) | Creates a mixer used to blend playables generated by clips on the track. |
| DeleteClip(TimelineClip) | Delete a clip from this track. |
| DeleteMarker(IMarker) | Removes a marker from the current asset. |
| GatherProperties(PlayableDirector, IPropertyCollector) | Called by the Timeline Editor to gather properties requiring preview. |
| GetAnimationClipHash(AnimationClip) | |
| GetChildTracks() | The list of subtracks or child tracks attached to this track. |
| GetClips() | A list of clips owned by this track |
| GetMarker(int) | Returns the marker at a given position, on the current asset. |
| GetMarkerCount() | Returns the number of markers on the current asset. |
| GetMarkers() | Returns an enumerable list of markers on the current asset. |
| OnAfterTrackDeserialize() | |
| OnBeforeTrackSerialize() | |
| OnCreateClip(TimelineClip) | Called when a clip is created on a track. |