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