Class TrackEditor | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class TrackEditor

    Use this class to customize track types in the TimelineEditor.

    Inheritance
    System.Object
    TrackEditor
    Namespace: UnityEditor.Timeline
    Syntax
    public class TrackEditor

    Fields

    DefaultTrackHeight

    The default height of a track.

    Declaration
    public static readonly float DefaultTrackHeight
    Field Value
    Type Description
    System.Single

    MaximumTrackHeight

    The maximum height of a track.

    Declaration
    public static readonly float MaximumTrackHeight
    Field Value
    Type Description
    System.Single

    MinimumTrackHeight

    The minimum unscaled height of a track.

    Declaration
    public static readonly float MinimumTrackHeight
    Field Value
    Type Description
    System.Single

    Methods

    GetBindingType(TrackAsset)

    Gets the binding type for a track.

    Declaration
    public Type GetBindingType(TrackAsset track)
    Parameters
    Type Name Description
    TrackAsset track

    The track to retrieve the binding type from.

    Returns
    Type Description
    System.Type

    Returns the binding type for the specified track. Returns null if the track does not have binding.

    GetErrorText(TrackAsset, Object, TrackBindingErrors)

    Gets the error text for the specified track.

    Declaration
    public string GetErrorText(TrackAsset track, Object boundObject, TrackBindingErrors detectErrors)
    Parameters
    Type Name Description
    TrackAsset track

    The track to retrieve options for.

    UnityEngine.Object boundObject

    The binding for the track.

    TrackBindingErrors detectErrors

    The errors to check for.

    Returns
    Type Description
    System.String

    An error to be displayed on the track, or string.Empty if there is no error.

    GetTrackColor(TrackAsset)

    Gets the color information of a track.

    Declaration
    public Color GetTrackColor(TrackAsset track)
    Parameters
    Type Name Description
    TrackAsset track
    Returns
    Type Description
    Color

    Returns the color for the specified track.

    GetTrackOptions(TrackAsset, Object)

    Implement this method to override the default options for drawing a track.

    Declaration
    public virtual TrackDrawOptions GetTrackOptions(TrackAsset track, Object binding)
    Parameters
    Type Name Description
    TrackAsset track

    The track from which track options are retrieved.

    UnityEngine.Object binding

    The binding for the track.

    Returns
    Type Description
    TrackDrawOptions

    The options for drawing the track.

    OnCreate(TrackAsset, TrackAsset)

    Callback for when a track is created.

    Declaration
    public virtual void OnCreate(TrackAsset track, TrackAsset copiedFrom)
    Parameters
    Type Name Description
    TrackAsset track

    The track that is created.

    TrackAsset copiedFrom

    The source that the track is copied from. This can be set to null if the track is not a copy.

    OnTrackChanged(TrackAsset)

    Callback for when a track is changed.

    Declaration
    public virtual void OnTrackChanged(TrackAsset track)
    Parameters
    Type Name Description
    TrackAsset track

    The track that is changed.

    In This Article
    • Fields
      • DefaultTrackHeight
      • MaximumTrackHeight
      • MinimumTrackHeight
    • Methods
      • GetBindingType(TrackAsset)
      • GetErrorText(TrackAsset, Object, TrackBindingErrors)
      • GetTrackColor(TrackAsset)
      • GetTrackOptions(TrackAsset, Object)
      • OnCreate(TrackAsset, TrackAsset)
      • OnTrackChanged(TrackAsset)
    Back to top
    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