docs.unity3d.com
    Show / Hide Table of Contents

    Class TrackEditor

    Use this class to customize track types in the TimelineEditor.

    Inheritance
    Object
    TrackEditor
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    Single

    MaximumTrackHeight

    The maximum height of a track.

    Declaration
    public static readonly float MaximumTrackHeight
    Field Value
    Type Description
    Single

    MinimumTrackHeight

    The minimum unscaled height of a track.

    Declaration
    public static readonly float MinimumTrackHeight
    Field Value
    Type Description
    Single

    Methods

    GetBindingFrom(Object, TrackAsset)

    Override this method to determine which object to bind to track. A binding object should be determined from candidate.

    By default, the TrackBindingType attribute from track will be used to determine the binding.

    Declaration
    public virtual Object GetBindingFrom(Object candidate, TrackAsset track)
    Parameters
    Type Name Description
    Object candidate

    The source object from which a track binding should be determined.

    TrackAsset track

    The track to bind an object to.

    Returns
    Type Description
    Object

    The object to bind to track.

    See Also
    TrackBindingTypeAttribute
    TrackAsset

    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
    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.

    Object boundObject

    The binding for the track.

    TrackBindingErrors detectErrors

    The errors to check for.

    Returns
    Type Description
    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.

    Object binding

    The binding for the track.

    Returns
    Type Description
    TrackDrawOptions

    The options for drawing the track.

    IsBindingAssignableFrom(Object, TrackAsset)

    Override this method to validate if a binding for track can be determined from candidate.

    The default implementation of this method will return true if

    • candidate is not null or,
    • candidate is not part of a Prefab Asset or,
    • candidate is a Component that can be bound to track
    Declaration
    public virtual bool IsBindingAssignableFrom(Object candidate, TrackAsset track)
    Parameters
    Type Name Description
    Object candidate
    TrackAsset track

    TBD

    Returns
    Type Description
    Boolean

    True if a binding can be determined from candidate.

    See Also
    TrackBindingTypeAttribute
    TrackAsset

    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.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, August 30, 2023