Class TrackEditor
Use this class to customize track types in the TimelineEditor.
Inherited Members
Namespace: UnityEditor .Timeline
Assembly: Unity.Timeline.Editor.dll
Syntax
public class TrackEditor
Fields
DefaultTrackHeight
The default height of a track.
Declaration
public static readonly float DefaultTrackHeight
Field Value
Type | Description |
---|---|
float |
MaximumTrackHeight
The maximum height of a track.
Declaration
public static readonly float MaximumTrackHeight
Field Value
Type | Description |
---|---|
float |
MinimumTrackHeight
The minimum unscaled height of a track.
Declaration
public static readonly float MinimumTrackHeight
Field Value
Type | Description |
---|---|
float |
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. |
Track |
track | The track to bind an object to. |
Returns
Type | Description |
---|---|
Object | The object to bind to |
See Also
GetBindingType(TrackAsset)
Gets the binding type for a track.
Declaration
public Type GetBindingType(TrackAsset track)
Parameters
Type | Name | Description |
---|---|---|
Track |
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 |
---|---|---|
Track |
track | The track to retrieve options for. |
Object | boundObject | The binding for the track. |
Track |
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 |
---|---|---|
Track |
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 |
---|---|---|
Track |
track | The track from which track options are retrieved. |
Object | binding | The binding for the track. |
Returns
Type | Description |
---|---|
Track |
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 totrack
Declaration
public virtual bool IsBindingAssignableFrom(Object candidate, TrackAsset track)
Parameters
Type | Name | Description |
---|---|---|
Object | candidate | |
Track |
track | TBD |
Returns
Type | Description |
---|---|
bool | True if a binding can be determined from |
See Also
OnCreate(TrackAsset, TrackAsset)
Callback for when a track is created.
Declaration
public virtual void OnCreate(TrackAsset track, TrackAsset copiedFrom)
Parameters
Type | Name | Description |
---|---|---|
Track |
track | The track that is created. |
Track |
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 |
---|---|---|
Track |
track | The track that is changed. |