docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TimelineAssetExtensions

    A collection of helpers to manipulate TimelineAsset instances.

    Inheritance
    object
    TimelineAssetExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Sequences.Timeline
    Assembly: Unity.Sequences.dll
    Syntax
    public static class TimelineAssetExtensions

    Methods

    FindDirector(TimelineAsset)

    Finds a PlayableDirector in loaded scenes that references the given TimelineAsset.

    Declaration
    public static PlayableDirector FindDirector(this TimelineAsset timeline)
    Parameters
    Type Name Description
    TimelineAsset timeline

    The instance of TimelineAsset to look for.

    Returns
    Type Description
    PlayableDirector

    Null when no matching PlayableDirector is found.

    GetOrCreateTrack<T>(TimelineAsset, string)

    Gets a track of type T with the specified name. Creates a new track with the specified name if none is found.

    Declaration
    public static T GetOrCreateTrack<T>(this TimelineAsset asset, string name) where T : TrackAsset, new()
    Parameters
    Type Name Description
    TimelineAsset asset

    The instance of TimelineAsset to look into.

    string name

    The name the TrackAsset has in Timeline.

    Returns
    Type Description
    T

    A valid instance of a TrackAsset of type T.

    Type Parameters
    Name Description
    T

    The type of the track to look for.

    GetScenes(TimelineAsset)

    Gets a collection of scene paths found in the given timeline.

    Declaration
    public static IReadOnlyCollection<string> GetScenes(this TimelineAsset timeline)
    Parameters
    Type Name Description
    TimelineAsset timeline

    The instance of TimelineAsset this method applies to.

    Returns
    Type Description
    IReadOnlyCollection<string>

    A read only collection of paths, relative to the project folder.

    GetTrack<T>(TimelineAsset, string)

    Gets a track of type T with the specified name.

    Declaration
    public static T GetTrack<T>(this TimelineAsset asset, string name) where T : TrackAsset
    Parameters
    Type Name Description
    TimelineAsset asset

    The instance of TimelineAsset to look into.

    string name

    The name the TrackAsset has in Timeline.

    Returns
    Type Description
    T

    Null when no matching track is found.

    Type Parameters
    Name Description
    T

    The type of the track to look for.

    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)