C# Class UnityEngine.Timeline.TrackAsset

Inheritance: PlayableAsset, ISerializationCallbackReceiver, IPropertyPreview
显示文件 Open project: 334499p/Portfolio Class Usage Examples

Private Properties

Property Type Description
AddChild void
AddClip void
AddMarker void
CanCompileClips bool
CanCompileClipsRecursive bool
CanCompileNotifications bool
ClearClipsInternal void
ClearMarkers void
ClearSubTracksInternal void
CompileClips Playable
ConfigureTrackAnimation void
CreateAndAddNewClipOfType UnityEngine.Timeline.TimelineClip
CreateClip UnityEngine.Timeline.TimelineClip
CreateClipFromAsset UnityEngine.Timeline.TimelineClip
CreateClipFromPlayableAsset UnityEngine.Timeline.TimelineClip
CreateClipOfType UnityEngine.Timeline.TimelineClip
CreateNewClipContainerInternal UnityEngine.Timeline.TimelineClip
CreateNotificationsPlayable Playable
CreatePlayableGraph Playable
DeleteMarkerRaw bool
GatherCompilableTracks void
GatherNotificiations void
GetClipsHash int
GetEvaluationTime void
GetGameObjectBinding GameObject
GetMarkersRaw IEnumerable
GetNotificationDuration double
GetSequenceTime void
GetTimeRangeHash int
HasNotifications bool
Hash int
Invalidate void
IsCompilable bool
MarkDirty void
MoveLastTrackBefore void
OnClipMove void
OnCreateClipPlayableGraph Playable
RemoveClip void
RemoveSubTrack bool
SortClips void
UpdateChildTrackCache void
UpdateDuration void
ValidateClipType bool
__internalAwake void

Public Methods

Method Description
CreateClip ( ) : UnityEngine.Timeline.TimelineClip

Creates a clip on the track with a playable asset attached, whose derived type is specified by T

Throws an InvalidOperationException if the specified type is not supported by the track. Supported types are determined by TrackClip attributes that decorate the TrackAsset derived class

CreateCurves ( string curvesClipName ) : void

Creates an AnimationClip to store animated properties for the attached PlayableAsset.

If curves already exists for this track, this method produces no result regardless of the value specified for curvesClipName.When used from the editor, this method attempts to save the created curves clip to the TimelineAsset. The TimelineAsset must already exist in the AssetDatabase to save the curves clip. If the TimelineAsset does not exist, the curves clip is still created but it is not saved.

CreateDefaultClip ( ) : UnityEngine.Timeline.TimelineClip

Creates a TimelineClip on this track.

The type of the playable asset attached to the clip is determined by TrackClip attributes that decorate the TrackAsset derived class

CreateMarker ( Type type, double time ) : IMarker

Creates a marker of the requested type, at a specific time, and adds the marker to the current asset.

All markers that implement IMarker and inherit from UnityEngine.ScriptableObject are supported. Markers that implement the INotification interface cannot be added to tracks that do not support notifications. CreateMarker will throw an InvalidOperationException with tracks that do not support notifications if type implements the INotification interface.

CreateMarker ( double time ) : T

Creates a marker of the requested type, at a specific time, and adds the marker to the current asset.

All markers that implement IMarker and inherit from UnityEngine.ScriptableObject are supported. CreateMarker will throw an InvalidOperationException with tracks that do not support notifications if T implements the INotification interface.

CreatePlayable ( PlayableGraph graph, GameObject go ) : Playable

Overrides PlayableAsset.CreatePlayable(). Not used in Timeline.

CreateTrackMixer ( PlayableGraph graph, GameObject go, int inputCount ) : Playable

Creates a mixer used to blend playables generated by clips on the track.

Override this method to provide a custom playable for mixing clips on a graph.

DeleteMarker ( IMarker marker ) : bool

Removes a marker from the current asset.

GatherProperties ( PlayableDirector director, IPropertyCollector driver ) : void

Called by the Timeline Editor to gather properties requiring preview.

GetChildTracks ( ) : IEnumerable

The list of subtracks or child tracks attached to this track.

In the case of GroupTracks, this returns all tracks contained in the group. This will return the all subtracks or override tracks, if supported by the track.

GetClips ( ) : IEnumerable

A list of clips owned by this track

GetMarker ( int idx ) : IMarker

Returns the marker at a given position, on the current asset.

The ordering of the markers is not guaranteed.

GetMarkerCount ( ) : int

Returns the number of markers on the current asset.

GetMarkers ( ) : IEnumerable

Returns an enumerable list of markers on the current asset.

Protected Methods

Method Description
CalculateItemsHash ( ) : int
CreatePlayable ( PlayableGraph graph, GameObject gameObject, UnityEngine.Timeline.TimelineClip clip ) : Playable

Constructs a Playable from a TimelineClip.

By default, this method invokes Playable.CreatePlayable, sets animated properties, and sets the speed of the created playable. Override this method to change this default implementation.

GetAnimationClipHash ( AnimationClip clip ) : int
OnCreateClip ( UnityEngine.Timeline.TimelineClip clip ) : void

Called when a clip is created on a track.

Use this method to set default values on a timeline clip, or it's PlayableAsset.

Private Methods

Method Description
AddChild ( TrackAsset child ) : void
AddClip ( UnityEngine.Timeline.TimelineClip newClip ) : void
AddMarker ( ScriptableObject e ) : void
CanCompileClips ( ) : bool
CanCompileClipsRecursive ( ) : bool
CanCompileNotifications ( ) : bool
ClearClipsInternal ( ) : void
ClearMarkers ( ) : void
ClearSubTracksInternal ( ) : void
CompileClips ( PlayableGraph graph, GameObject go, IList timelineClips, UnityEngine.Timeline.IntervalTree tree ) : Playable
ConfigureTrackAnimation ( UnityEngine.Timeline.IntervalTree tree, GameObject go, Playable blend ) : void
CreateAndAddNewClipOfType ( Type requestedType ) : UnityEngine.Timeline.TimelineClip
CreateClip ( Type requestedType ) : UnityEngine.Timeline.TimelineClip
CreateClipFromAsset ( ScriptableObject playableAsset ) : UnityEngine.Timeline.TimelineClip
CreateClipFromPlayableAsset ( IPlayableAsset asset ) : UnityEngine.Timeline.TimelineClip

Creates a timeline clip from an existing playable asset.

CreateClipOfType ( Type requestedType ) : UnityEngine.Timeline.TimelineClip
CreateNewClipContainerInternal ( ) : UnityEngine.Timeline.TimelineClip
CreateNotificationsPlayable ( PlayableGraph graph, Playable mixerPlayable, GameObject go, Playable timelinePlayable ) : Playable
CreatePlayableGraph ( PlayableGraph graph, GameObject go, UnityEngine.Timeline.IntervalTree tree, Playable timelinePlayable ) : Playable
DeleteMarkerRaw ( ScriptableObject marker ) : bool
GatherCompilableTracks ( IList tracks ) : void
GatherNotificiations ( List markers ) : void
GetClipsHash ( ) : int
GetEvaluationTime ( double &outStart, double &outDuration ) : void
GetGameObjectBinding ( PlayableDirector director ) : GameObject
GetMarkersRaw ( ) : IEnumerable
GetNotificationDuration ( ) : double
GetSequenceTime ( double &outStart, double &outDuration ) : void
GetTimeRangeHash ( ) : int
HasNotifications ( ) : bool
Hash ( ) : int
Invalidate ( ) : void
IsCompilable ( ) : bool
MarkDirty ( ) : void
MoveLastTrackBefore ( TrackAsset asset ) : void
OnClipMove ( ) : void
OnCreateClipPlayableGraph ( PlayableGraph graph, GameObject go, UnityEngine.Timeline.IntervalTree tree ) : Playable
RemoveClip ( UnityEngine.Timeline.TimelineClip clip ) : void
RemoveSubTrack ( TrackAsset child ) : bool
SortClips ( ) : void
UpdateChildTrackCache ( ) : void
UpdateDuration ( ) : void
ValidateClipType ( Type clipType ) : bool
__internalAwake ( ) : void

Method Details

CalculateItemsHash() protected method

protected CalculateItemsHash ( ) : int
return int

CreateClip() public method

Creates a clip on the track with a playable asset attached, whose derived type is specified by T
Throws an InvalidOperationException if the specified type is not supported by the track. Supported types are determined by TrackClip attributes that decorate the TrackAsset derived class
public CreateClip ( ) : UnityEngine.Timeline.TimelineClip
return UnityEngine.Timeline.TimelineClip

CreateCurves() public method

Creates an AnimationClip to store animated properties for the attached PlayableAsset.
If curves already exists for this track, this method produces no result regardless of the value specified for curvesClipName. When used from the editor, this method attempts to save the created curves clip to the TimelineAsset. The TimelineAsset must already exist in the AssetDatabase to save the curves clip. If the TimelineAsset does not exist, the curves clip is still created but it is not saved.
public CreateCurves ( string curvesClipName ) : void
curvesClipName string /// The name of the AnimationClip to create. /// This method does not ensure unique names. If you want a unique clip name, you must provide one. /// See ObjectNames.GetUniqueName for information on a method that creates unique names. ///
return void

CreateDefaultClip() public method

Creates a TimelineClip on this track.
The type of the playable asset attached to the clip is determined by TrackClip attributes that decorate the TrackAsset derived class
public CreateDefaultClip ( ) : UnityEngine.Timeline.TimelineClip
return UnityEngine.Timeline.TimelineClip

CreateMarker() public method

Creates a marker of the requested type, at a specific time, and adds the marker to the current asset.
All markers that implement IMarker and inherit from UnityEngine.ScriptableObject are supported. Markers that implement the INotification interface cannot be added to tracks that do not support notifications. CreateMarker will throw an InvalidOperationException with tracks that do not support notifications if type implements the INotification interface.
public CreateMarker ( Type type, double time ) : IMarker
type Type The type of marker.
time double The time where the marker is created.
return IMarker

CreateMarker() public method

Creates a marker of the requested type, at a specific time, and adds the marker to the current asset.
All markers that implement IMarker and inherit from UnityEngine.ScriptableObject are supported. CreateMarker will throw an InvalidOperationException with tracks that do not support notifications if T implements the INotification interface.
public CreateMarker ( double time ) : T
time double The time where the marker is created.
return T

CreatePlayable() public final method

Overrides PlayableAsset.CreatePlayable(). Not used in Timeline.
public final CreatePlayable ( PlayableGraph graph, GameObject go ) : Playable
graph PlayableGraph
go GameObject
return Playable

CreatePlayable() protected method

Constructs a Playable from a TimelineClip.
By default, this method invokes Playable.CreatePlayable, sets animated properties, and sets the speed of the created playable. Override this method to change this default implementation.
Thrown if the specified PlayableGraph is not valid. Thrown if the specified TimelineClip is not valid.
protected CreatePlayable ( PlayableGraph graph, GameObject gameObject, UnityEngine.Timeline.TimelineClip clip ) : Playable
graph PlayableGraph PlayableGraph that will own the playable.
gameObject GameObject The GameObject that builds the PlayableGraph.
clip UnityEngine.Timeline.TimelineClip The TimelineClip to construct a playable for.
return Playable

CreateTrackMixer() public method

Creates a mixer used to blend playables generated by clips on the track.
Override this method to provide a custom playable for mixing clips on a graph.
public CreateTrackMixer ( PlayableGraph graph, GameObject go, int inputCount ) : Playable
graph PlayableGraph The graph to inject playables into
go GameObject The GameObject that requested the graph.
inputCount int The number of playables from clips that will be inputs to the returned mixer
return Playable

DeleteMarker() public method

Removes a marker from the current asset.
public DeleteMarker ( IMarker marker ) : bool
marker IMarker The marker instance to be removed.
return bool

GatherProperties() public method

Called by the Timeline Editor to gather properties requiring preview.
public GatherProperties ( PlayableDirector director, IPropertyCollector driver ) : void
director PlayableDirector The PlayableDirector invoking the preview
driver IPropertyCollector PropertyCollector used to gather previewable properties
return void

GetAnimationClipHash() protected static method

protected static GetAnimationClipHash ( AnimationClip clip ) : int
clip AnimationClip
return int

GetChildTracks() public method

The list of subtracks or child tracks attached to this track.
In the case of GroupTracks, this returns all tracks contained in the group. This will return the all subtracks or override tracks, if supported by the track.
public GetChildTracks ( ) : IEnumerable
return IEnumerable

GetClips() public method

A list of clips owned by this track
public GetClips ( ) : IEnumerable
return IEnumerable

GetMarker() public method

Returns the marker at a given position, on the current asset.
The ordering of the markers is not guaranteed.
public GetMarker ( int idx ) : IMarker
idx int The index of the marker to be returned.
return IMarker

GetMarkerCount() public method

Returns the number of markers on the current asset.
public GetMarkerCount ( ) : int
return int

GetMarkers() public method

Returns an enumerable list of markers on the current asset.
public GetMarkers ( ) : IEnumerable
return IEnumerable

OnCreateClip() protected method

Called when a clip is created on a track.
Use this method to set default values on a timeline clip, or it's PlayableAsset.
protected OnCreateClip ( UnityEngine.Timeline.TimelineClip clip ) : void
clip UnityEngine.Timeline.TimelineClip The timeline clip added to this track
return void