docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TimelineNavigator

    Interface to navigate through Timelines and SubTimelines for the Timeline window.

    Inheritance
    object
    TimelineNavigator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Timeline
    Assembly: Unity.Timeline.Editor.dll
    Syntax
    public sealed class TimelineNavigator
    Remarks

    TimelineNavigator gives you access to the Timeline window breadcrumbs functionality. Use it to programmatically dig into SubTimelines, navigate to parent Timelines or navigate Timeline Window breadcrumbs.

    Methods

    GetBreadcrumbs()

    Gets the collection of SequenceContexts associated with the breadcrumbs shown in the TimelineEditorWindow.

    Declaration
    public IEnumerable<SequenceContext> GetBreadcrumbs()
    Returns
    Type Description
    IEnumerable<SequenceContext>

    The collection of SequenceContexts associated with the breadcrumbs shown in the TimelineEditorWindow, from the root context to the current context.

    Remarks

    This operation can be expensive. Consider caching the results instead of calling the method multiple times.

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    GetChildContexts()

    Gets the collection of child contexts that can be navigated to from the current context.

    Declaration
    public IEnumerable<SequenceContext> GetChildContexts()
    Returns
    Type Description
    IEnumerable<SequenceContext>

    The collection of child contexts that can be navigated to from the current context.

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    GetCurrentContext()

    Gets the SequenceContext associated with the Timeline currently shown in the Timeline window.

    Declaration
    public SequenceContext GetCurrentContext()
    Returns
    Type Description
    SequenceContext

    The SequenceContext associated with the Timeline currently shown in the Timeline window.

    Remarks

    Equivalent to TimelineNavigator.GetBreadCrumbs().Last()

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    GetParentContext()

    Gets the parent SequenceContext for the Timeline currently shown in the Timeline window.

    Declaration
    public SequenceContext GetParentContext()
    Returns
    Type Description
    SequenceContext

    The parent SequenceContext for the Timeline currently shown in the Timeline window if there is one; an invalid SequenceContext otherwise. Invalid

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    GetRootContext()

    Gets the first SequenceContext in the breadcrumbs.

    Declaration
    public SequenceContext GetRootContext()
    Returns
    Type Description
    SequenceContext

    The first SequenceContext in the breadcrumbs.

    Remarks

    Equivalent to TimelineNavigator.GetBreadCrumbs().First()

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    NavigateTo(SequenceContext)

    Navigates to a new SequenceContext.

    Declaration
    public void NavigateTo(SequenceContext context)
    Parameters
    Type Name Description
    SequenceContext context

    The context to navigate to.

    Remarks

    The SequenceContext provided must be a valid navigation destination.

    Valid navigation destinations:

    • The parent context returned by GetParentContext().
    • The root context returned by GetRootContext().
    • Any SequenceContext returned by GetChildContexts().
    • Any SequenceContext returned by GetBreadcrumbs().

    Note: This method cannot be used to change the root SequenceContext. To change the root SequenceContext, use SetTimeline(TimelineAsset).

    Exceptions
    Type Condition
    InvalidOperationException

    The Window associated to this instance has been destroyed.

    ArgumentException

    The context is not valid.

    InvalidOperationException

    The context is not a valid navigation destination.

    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)