docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Sequence

    Sequence is a base object to define a time unit in a MasterSequence (in a cinematic).

    Inheritance
    object
    Sequence
    TimelineSequence
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Sequences
    Assembly: Unity.Sequences.dll
    Syntax
    [Serializable]
    [MovedFrom(false, "UnityEngine.CinematicToolbox", "Unity.CinematicToolbox", "CinematicClip")]
    public class Sequence

    Constructors

    Sequence()

    Default constructor, create a default SequenceManager.

    Declaration
    public Sequence()

    Fields

    m_Duration

    The duration of the Sequence.

    Declaration
    [SerializeField]
    protected double m_Duration
    Field Value
    Type Description
    double

    m_Fps

    The framerate of the Sequence.

    Declaration
    [SerializeField]
    protected float m_Fps
    Field Value
    Type Description
    float

    m_Name

    The name of the Sequence.

    Declaration
    [SerializeField]
    protected string m_Name
    Field Value
    Type Description
    string

    m_Start

    The start time of the Sequence.

    Declaration
    [SerializeField]
    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
    float

    hasChildren

    Get whether the Sequence has children or not.

    Declaration
    public bool hasChildren { get; }
    Property Value
    Type Description
    bool

    isFpsInherited

    Indicates whether the framerate inherited its value from the parent Sequence or not.

    Declaration
    protected bool isFpsInherited { get; }
    Property Value
    Type Description
    bool

    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.

    Exceptions
    Type Condition
    ArgumentException

    When newStart is negative.

    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>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)