docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TimelineAsset

    A PlayableAsset that represents a timeline.

    Inheritance
    object
    Object
    ScriptableObject
    PlayableAsset
    TimelineAsset
    Implements
    IPlayableAsset
    ISerializationCallbackReceiver
    ITimelineClipAsset
    IPropertyPreview
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Timeline
    Assembly: Unity.Timeline.dll
    Syntax
    [ExcludeFromPreset]
    [Serializable]
    public class TimelineAsset : PlayableAsset, IPlayableAsset, ISerializationCallbackReceiver, ITimelineClipAsset, IPropertyPreview

    Properties

    clipCaps

    The capabilities supported by all clips in the timeline.

    Declaration
    public ClipCaps clipCaps { get; }
    Property Value
    Type Description
    ClipCaps

    duration

    The length, in seconds, of the timeline

    Declaration
    public override double duration { get; }
    Property Value
    Type Description
    double
    Overrides
    PlayableAsset.duration

    durationMode

    The mode used to determine the duration of the Timeline

    Declaration
    public TimelineAsset.DurationMode durationMode { get; set; }
    Property Value
    Type Description
    TimelineAsset.DurationMode

    editorSettings

    Settings used by timeline for editing purposes

    Declaration
    public TimelineAsset.EditorSettings editorSettings { get; }
    Property Value
    Type Description
    TimelineAsset.EditorSettings

    fixedDuration

    The length of the timeline when durationMode is set to fixed length.

    Declaration
    public double fixedDuration { get; set; }
    Property Value
    Type Description
    double

    markerTrack

    Gets the marker track for this TimelineAsset.

    Declaration
    public MarkerTrack markerTrack { get; }
    Property Value
    Type Description
    MarkerTrack

    The marker track.

    Remarks

    Use GetMarkers() to get a list of the markers on the returned track.

    outputTrackCount

    Returns the the number of output tracks in the Timeline.

    Declaration
    public int outputTrackCount { get; }
    Property Value
    Type Description
    int
    Remarks

    An output track is a track the generates a PlayableOutput. In general, an output track is any track that is not a GroupTrack, a subtrack, or override track.

    outputs

    A description of the PlayableOutputs that will be created by the timeline when instantiated.

    Declaration
    public override IEnumerable<PlayableBinding> outputs { get; }
    Property Value
    Type Description
    IEnumerable<PlayableBinding>
    Overrides
    PlayableAsset.outputs
    Remarks

    Each track will create an PlayableOutput

    rootTrackCount

    Returns the number of tracks at the root level of the timeline.

    Declaration
    public int rootTrackCount { get; }
    Property Value
    Type Description
    int
    Remarks

    A root track refers to all tracks that occur at the root of the timeline. These are the outmost level GroupTracks, and output tracks that do not belong to any group

    Methods

    CreateMarkerTrack()

    Creates a marker track for the TimelineAsset.

    Declaration
    public void CreateMarkerTrack()
    Remarks

    In the editor, the marker track appears under the Timeline ruler. This track is always bound to the GameObject that contains the PlayableDirector component for the current timeline. The marker track is created the first time this method is called. If the marker track is already created, this method does nothing.

    CreatePlayable(PlayableGraph, GameObject)

    Creates an instance of the timeline

    Declaration
    public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
    Parameters
    Type Name Description
    PlayableGraph graph

    PlayableGraph that will own the playable

    GameObject go

    The gameobject that triggered the graph build

    Returns
    Type Description
    Playable

    The Root Playable of the Timeline

    Overrides
    PlayableAsset.CreatePlayable(PlayableGraph, GameObject)

    CreateTrack(Type, TrackAsset, string)

    Allows you to create a track and add it to the Timeline.

    Declaration
    public TrackAsset CreateTrack(Type type, TrackAsset parent, string name)
    Parameters
    Type Name Description
    Type type

    The type of track to create. Must derive from TrackAsset.

    TrackAsset parent

    Track to parent to. This can be null.

    string name

    Name to give the track.

    Returns
    Type Description
    TrackAsset

    The created track.

    Remarks

    This method will throw an InvalidOperationException if the parent is not valid. The parent can be any GroupTrack, or a supported parent type of track. For example, this can be used to create override tracks in AnimationTracks.

    CreateTrack<T>()

    Creates a track and adds it to the Timeline Asset.

    Declaration
    public T CreateTrack<T>() where T : TrackAsset, new()
    Returns
    Type Description
    T

    Returns the created track.

    Type Parameters
    Name Description
    T

    The type of track being created. The track type must be derived from TrackAsset.

    CreateTrack<T>(string)

    Creates a track and adds it to the Timeline Asset.

    Declaration
    public T CreateTrack<T>(string trackName) where T : TrackAsset, new()
    Parameters
    Type Name Description
    string trackName

    The name of the track being created.

    Returns
    Type Description
    T

    Returns the created track.

    Type Parameters
    Name Description
    T

    The type of track being created. The track type must be derived from TrackAsset.

    CreateTrack<T>(TrackAsset, string)

    Creates a track and adds it to the Timeline Asset.

    Declaration
    public T CreateTrack<T>(TrackAsset parent, string trackName) where T : TrackAsset, new()
    Parameters
    Type Name Description
    TrackAsset parent

    Track to parent to. This can be null.

    string trackName

    The name of the track being created.

    Returns
    Type Description
    T

    Returns the created track.

    Type Parameters
    Name Description
    T

    The type of track being created. The track type must be derived from TrackAsset.

    Remarks

    This method will throw an InvalidOperationException if the parent is not valid. The parent can be any GroupTrack, or a supported parent type of track. For example, this can be used to create override tracks in AnimationTracks.

    DeleteClip(TimelineClip)

    Delete a clip from this timeline.

    Declaration
    public bool DeleteClip(TimelineClip clip)
    Parameters
    Type Name Description
    TimelineClip clip

    The clip to delete.

    Returns
    Type Description
    bool

    Returns true if the removal was successful

    Remarks

    This method will delete a clip and any assets owned by the clip.

    DeleteTrack(TrackAsset)

    Deletes a track from a timeline, including all clips and subtracks.

    Declaration
    public bool DeleteTrack(TrackAsset track)
    Parameters
    Type Name Description
    TrackAsset track

    The track to delete. It must be owned by this Timeline.

    Returns
    Type Description
    bool

    True if the track was deleted successfully.

    GatherProperties(PlayableDirector, IPropertyCollector)

    Called by the Timeline Editor to gather properties requiring preview.

    Declaration
    public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    Parameters
    Type Name Description
    PlayableDirector director

    The PlayableDirector invoking the preview

    IPropertyCollector driver

    PropertyCollector used to gather previewable properties

    GetOutputTrack(int)

    Retrives the output track from the given index.

    Declaration
    public TrackAsset GetOutputTrack(int index)
    Parameters
    Type Name Description
    int index

    Index of the output track to retrieve. Must be between 0 and outputTrackCount

    Returns
    Type Description
    TrackAsset

    The output track from the given index

    GetOutputTracks()

    Gets a list of all output tracks in the Timeline.

    Declaration
    public IEnumerable<TrackAsset> GetOutputTracks()
    Returns
    Type Description
    IEnumerable<TrackAsset>

    An IEnumerable of all output tracks

    Remarks

    An output track is a track the generates a PlayableOutput. In general, an output track is any track that is not a GroupTrack or subtrack.

    GetRootTrack(int)

    Retrieves at root track at the specified index.

    Declaration
    public TrackAsset GetRootTrack(int index)
    Parameters
    Type Name Description
    int index

    Index of the root track to get. Must be between 0 and rootTrackCount

    Returns
    Type Description
    TrackAsset

    Root track at the specified index.

    Remarks

    A root track refers to all tracks that occur at the root of the timeline. These are the outmost level GroupTracks, and output tracks that do not belong to any group.

    GetRootTracks()

    Get an enumerable list of all root tracks.

    Declaration
    public IEnumerable<TrackAsset> GetRootTracks()
    Returns
    Type Description
    IEnumerable<TrackAsset>

    An IEnumerable of all root tracks.

    Remarks

    A root track refers to all tracks that occur at the root of the timeline. These are the outmost level GroupTracks, and output tracks that do not belong to any group.

    Implements

    IPlayableAsset
    ISerializationCallbackReceiver
    ITimelineClipAsset
    IPropertyPreview
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)