Pause in flow cross

Tue 4. Apr 2017, 10:13

Hi,

I have a question, maybe more Unity than Articy, but if you have an idea to solved it

Is there a mean to pause the flow cross? While it's not a Coroutine, I have no idea how do that. Because display an object of the flow will take a little time (like 1 or 2 second), and I would like to wait the end of this display before display the next item :/

Thank you

Have a nice day,

Zeldarck
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Re: Pause in flow cross

Tue 4. Apr 2017, 10:30

Hi Zeldarck,

i guess you are asking if you could pause the flow traversal. The thing is, once the flow player pauses on an object and notfying the object via "OnFlowPlayerPaused" the traversal engine under the hood is literally pausing and waiting until you call the method Play() again. Now you could very easily solve that by using a coroutine

Code: Select all
StartCoroutine(NextNodeIn(3));

IEnumerator NextNode(int aSeconds)
{
   yield return new WaitForSeconds(aSeconds);
   flowPlayer.Play();
}


But remember that the flow player will only pause on objects that are defined in your PauseOn so if you want to wait on a FlowFragment for example you must add it to the pauseOn, otherwise the flow player will just skip it not giving you any chance to react on it. This could look something like this:

Code: Select all
bool autoContinue;
public void OnFlowPlayerPaused(IFlowObject aObject)
{
   autoContinue = false;
   
    var fragment = aObject as FlowFragment;
    if(fragment != null)
    {
      ShowFlowFragmentInUI(fragment);
      
      autoContinue = true; // this tells the onBranchesUpdated that it doesn't need to do anything
      
        StartCoroutine(NextNodeIn(3)); // wait 3 seconds
      
      return; // no need to do anything else
    }
   
   // this is for everything else where you would actually want to pause
   .....
}

public void OnBranchesUpdated(IList<Branch> aBranches)
{
   if(autoContinue) return;

       .....
}


If thats not what you are asking for, i fear you have to give me a bit more information to help you.

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Pause in flow cross

Tue 4. Apr 2017, 12:26

Oh thank you, I didn't think at that, it was logic ^^'
User avatar
Zeldarck
 
Posts: 55
Joined: Thu 9. Mar 2017, 16:03

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 3 guests

Who We Are
Contact Us
Social Links