Triggering a Sequence

Trigger a sequence from a button

To trigger a sequence from a button, you will need to reference the Director of the sequence you want to play, and call the Play() method:


Trigger a sequence from script

To trigger a sequence from a script, you have two choices:

  • Trigger the sequence by referencing the UTA Director:
    public UTADirector m_Director;
    
    public void TriggerSequence()
    {
            m_Director.Play();
    }

    The Play method also has an optional Callback parameter of type Action, allowing you to execute code at the end of the sequence:

    public void TriggerSequence()
    {
            m_Director.Play(OnSequenceEnd);
    }
    
    private void OnSequenceEnd()
    {
    // Do Something
    }
  • Trigger the sequence by its name on the UTAController (it’s a singleton):
    public void TriggerSequence()
    {
            UTAController.Instance.PlaySequence("MySequenceName");
    }

    You can also use a specific ‘;’ syntax to trigger multiple sequences one after the other:

    public void TriggerMultipleSequences()
    {
            UTAController.Instance.PlaySequence("Sequence1;Sequence2;Sequence3");
    }

 

Next: Using an Automated Screen Flow