Class TimelineAssetExtensions
A collection of helpers to manipulate
Namespace: UnityEngine.Sequences.Timeline
Syntax
public static class TimelineAssetExtensions : object
Methods
FindDirector(TimelineAsset)
Finds a PlayableDirector in loaded scenes that references the given
Declaration
public static PlayableDirector FindDirector(this TimelineAsset timeline)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineAsset | timeline | The instance of |
Returns
| Type | Description |
|---|---|
| PlayableDirector | Null when no matching |
GetOrCreateTrack<T>(TimelineAsset, String)
Gets a track of type T with the specified name.
Creates a new track with the specified name if none is found.
Declaration
public static T GetOrCreateTrack<T>(this TimelineAsset asset, string name)
where T : TrackAsset, new()
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineAsset | asset | The instance of |
| String | name | The name the TrackAsset has in Timeline. |
Returns
| Type | Description |
|---|---|
| T | A valid instance of a |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the track to look for. |
GetScenes(TimelineAsset)
Gets a collection of scene paths found in the given timeline.
Declaration
public static IReadOnlyCollection<string> GetScenes(this TimelineAsset timeline)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineAsset | timeline | The instance of |
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<String> | A read only collection of paths, relative to the project folder. |
GetTrack<T>(TimelineAsset, String)
Gets a track of type T with the specified name.
Declaration
public static T GetTrack<T>(this TimelineAsset asset, string name)
where T : TrackAsset
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineAsset | asset | The instance of |
| String | name | The name the TrackAsset has in Timeline. |
Returns
| Type | Description |
|---|---|
| T | Null when no matching track is found. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the track to look for. |