Class ClipEditor
Use this class to customize clip types in the TimelineEditor.
Inherited Members
Namespace: UnityEditor.Timeline
Syntax
public class ClipEditor
Constructors
ClipEditor()
Default constructor
Declaration
public ClipEditor()
Methods
DrawBackground(TimelineClip, ClipBackgroundRegion)
Override this method to draw a background for a clip .
Declaration
public virtual void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip being drawn. |
ClipBackgroundRegion | region | The on-screen area where the clip is drawn. |
GetClipOptions(TimelineClip)
Implement this method to override the default options for drawing a clip.
Declaration
public virtual ClipDrawOptions GetClipOptions(TimelineClip clip)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip being drawn. |
Returns
Type | Description |
---|---|
ClipDrawOptions | The options for drawing a clip. |
GetDefaultHighlightColor(TimelineClip)
The color drawn under the clip. By default, the color is the same as the track color.
Declaration
public Color GetDefaultHighlightColor(TimelineClip clip)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip being drawn. |
Returns
Type | Description |
---|---|
Color | Returns the highlight color of the clip being drawn. |
GetErrorText(TimelineClip)
Gets the error text for the specified clip.
Declaration
public string GetErrorText(TimelineClip clip)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip being drawn. |
Returns
Type | Description |
---|---|
String | Returns the error text to be displayed as the tool tip for the clip. If there is no error to be displayed, this method returns string.Empty. |
GetSubTimelines(TimelineClip, PlayableDirector, List<PlayableDirector>)
Gets the sub-timelines for a specific clip. Implement this method if your clip supports playing nested timelines.
Declaration
public virtual void GetSubTimelines(TimelineClip clip, PlayableDirector director, List<PlayableDirector> subTimelines)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip with the ControlPlayableAsset. |
PlayableDirector | director | The playable director driving the Timeline Clip. This may not be the same as TimelineEditor.inspectedDirector. |
List<PlayableDirector> | subTimelines | Specify the sub-timelines to control. |
OnClipChanged(TimelineClip)
Called when a clip is changed by the Editor.
Declaration
public virtual void OnClipChanged(TimelineClip clip)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip that changed. |
OnCreate(TimelineClip, TrackAsset, TimelineClip)
Called when a clip is created.
Declaration
public virtual void OnCreate(TimelineClip clip, TrackAsset track, TimelineClip clonedFrom)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The newly created clip. |
TrackAsset | track | The track that the clip is assigned to. |
TimelineClip | clonedFrom | The source that the clip was copied from. This can be set to null if the clip is not a copy. |
Remarks
The callback occurs before the clip is assigned to the track.