Class Sequence
Sequence is a base object to define a time unit in a MasterSequence (in a cinematic).
Namespace: UnityEngine.Sequences
Syntax
public class Sequence : object
Constructors
Sequence()
Default constructor, create a default SequenceManager.
Declaration
public Sequence()
Fields
m_Duration
The duration of the Sequence.
Declaration
protected double m_Duration
Field Value
Type | Description |
---|---|
Double |
m_Fps
The framerate of the Sequence.
Declaration
protected float m_Fps
Field Value
Type | Description |
---|---|
Single |
m_Name
The name of the Sequence.
Declaration
protected string m_Name
Field Value
Type | Description |
---|---|
String |
m_Start
The start time of the Sequence.
Declaration
protected double m_Start
Field Value
Type | Description |
---|---|
Double |
Properties
children
Get an enumerable on the Sequence children.
Declaration
public IEnumerable<Sequence> children { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Sequence> |
duration
Get or set the Sequence duration (in seconds). The Sequence duration is computed from it's children duration if any.
Declaration
public virtual double duration { get; set; }
Property Value
Type | Description |
---|---|
Double |
end
Get the Sequence end time (in seconds). The end time is computed from the start time and duration of the Sequence.
Declaration
public double end { get; }
Property Value
Type | Description |
---|---|
Double |
fps
Get or set the fps of the Sequence. The fps is retrieved from the parent Sequence when it is not locally defined.
Declaration
public virtual float fps { get; set; }
Property Value
Type | Description |
---|---|
Single |
hasChildren
Get whether the Sequence has children or not.
Declaration
public bool hasChildren { get; }
Property Value
Type | Description |
---|---|
Boolean |
isFpsInherited
Indicates whether the framerate inherited its value from the parent Sequence or not.
Declaration
protected bool isFpsInherited { get; }
Property Value
Type | Description |
---|---|
Boolean |
name
Get or set the name of the masterSequence clip.
Declaration
public virtual string name { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
When setting a new name, sequenceRenamed event is triggered.
parent
Get or set the Sequence parent. When setting a parent, bi-directional links are updated (i.e. parent point to this and this point to parent). AddChild(Sequence) RemoveChild(Sequence)
Declaration
public Sequence parent { get; set; }
Property Value
Type | Description |
---|---|
Sequence |
start
Get or set the Sequence start time (in seconds). The Sequence start time is computed from its children start time if any.
Declaration
public virtual double start { get; set; }
Property Value
Type | Description |
---|---|
Double |
Methods
AddChild(Sequence)
Add the given child to the Sequence. The added child will have this as its parent. The start time and duration of the Sequence are re-computed and siblings are moved if needed. parent
Declaration
public virtual void AddChild(Sequence childClip)
Parameters
Type | Name | Description |
---|---|---|
Sequence | childClip | The child Sequence to add. |
AddChildClip(Sequence)
Add a child after all existing children (if any). AddChild(Sequence) parent
Declaration
protected virtual double AddChildClip(Sequence childClip)
Parameters
Type | Name | Description |
---|---|---|
Sequence | childClip | The child Sequence to add. |
Returns
Type | Description |
---|---|
Double | The actual start time of the added clip. |
Move(Double)
Move a clip in time. Other clips (siblings, parents and children) will be impacted accordingly.
Declaration
public virtual double Move(double newStart)
Parameters
Type | Name | Description |
---|---|---|
Double | newStart | The new start time of the clip. |
Returns
Type | Description |
---|---|
Double | The actual start time of the moved clip. |
ParentClip(Sequence)
Set the parent only. AddChild(Sequence) parent
Declaration
protected virtual void ParentClip(Sequence parentClip)
Parameters
Type | Name | Description |
---|---|---|
Sequence | parentClip | The parent Sequence to set. |
RemoveChild(Sequence)
Remove the given child from the masterSequence clip. The removed child will be un-parented from this. The start time and duration of the Sequence are re-computed and siblings are moved if needed. parent
Declaration
public virtual void RemoveChild(Sequence childClip)
Parameters
Type | Name | Description |
---|---|---|
Sequence | childClip | The child Sequence to remove. |
RemoveChildClip(Sequence)
Remove the child only. RemoveChild(Sequence) parent
Declaration
protected virtual void RemoveChildClip(Sequence childClip)
Parameters
Type | Name | Description |
---|---|---|
Sequence | childClip | The child Sequence to remove. |
SetDuration(Double)
Set the duration of the clip. Other clips (siblings and parents) will be impacted accordingly.
Declaration
public virtual void SetDuration(double newDuration)
Parameters
Type | Name | Description |
---|---|---|
Double | newDuration | The new duration of the clip. |
UnParentClip()
Unset the parent only. RemoveChild(Sequence) parent
Declaration
protected virtual void UnParentClip()
Events
sequenceRenamed
Called when the Sequence is renamed, name.
Declaration
public static event Action<Sequence> sequenceRenamed
Event Type
Type | Description |
---|---|
Action<Sequence> |