docs.unity3d.com
    Show / Hide Table of Contents

    Class TimelineAssetExtensions

    A collection of helpers to manipulate instances.

    Inheritance
    Object
    TimelineAssetExtensions
    Namespace: UnityEngine.Sequences.Timeline
    Syntax
    public static class TimelineAssetExtensions : object

    Methods

    FindDirector(TimelineAsset)

    Finds a PlayableDirector in loaded scenes that references the given .

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

    The instance of to look for.

    Returns
    Type Description
    PlayableDirector

    Null when no matching 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 to look into.

    String name

    The name the TrackAsset has in Timeline.

    Returns
    Type Description
    T

    A valid instance of a 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 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 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.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023