Class MasterSequence
The MasterSequence ScriptableObject serializes a hierarchy of Sequences and allows their creation and deletion.
Namespace: UnityEngine.Sequences
Syntax
public class MasterSequence : ScriptableObject
Properties
rootSequence
The root Sequence of the structure defined in the MasterSequence.
Declaration
public TimelineSequence rootSequence { get; }
Property Value
Type | Description |
---|---|
TimelineSequence |
Methods
CreateInstance(String, Single)
Creates a new MasterSequence instance.
Declaration
public static MasterSequence CreateInstance(string name, float fps = 24F)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the created MasterSequence. |
Single | fps | The framerate of the created MasterSequence. |
Returns
Type | Description |
---|---|
MasterSequence | The newly created MasterSequence. |
NewSequence(String, TimelineSequence)
Creates and adds a new Sequence to this MasterSequence.
Declaration
public TimelineSequence NewSequence(string clipName, TimelineSequence parent = null)
Parameters
Type | Name | Description |
---|---|---|
String | clipName | The name of the created Sequence. |
TimelineSequence | parent | The parent is the root sequence by default if you don't specify a value for this parameter. |
Returns
Type | Description |
---|---|
TimelineSequence | The newly created Sequence. |
Remarks
This function invokes the sequenceAdded event.
RemoveSequence(TimelineSequence)
Remove the specified Sequence and all its children from this MasterSequence.
Declaration
public IEnumerable<TimelineSequence> RemoveSequence(TimelineSequence sequence)
Parameters
Type | Name | Description |
---|---|---|
TimelineSequence | sequence | The Sequence to remove. |
Returns
Type | Description |
---|---|
IEnumerable<TimelineSequence> | Returns the list of sequences that was removed from this MasterSequence. That can be used for any post-processing like removing the associated assets from disk. |
Remarks
This function invokes the sequenceRemoved event.
Events
sequenceAdded
Event invoked when a new Sequence is added to a MasterSequence.
Declaration
public static event Action<MasterSequence, TimelineSequence> sequenceAdded
Event Type
Type | Description |
---|---|
Action<MasterSequence, TimelineSequence> |
sequenceRemoved
Event invoked when a Sequence is removed from a MasterSequence.
Declaration
public static event Action<MasterSequence, TimelineSequence> sequenceRemoved
Event Type
Type | Description |
---|---|
Action<MasterSequence, TimelineSequence> |