Hi!
I’m developing my first mobile game and i’m struggling with dialogues:
I made a container for the dialogue nodes called dialogue (wow… creativity at its finest…) which has a function like this:
public IEnumerator unravelDialogue()
{
//doStuff
//foreach node{
//do more stuff
yield return new WaitForSeconds(element.seconds);
}
}
point is i need to waitForSeconds OR for a tap… i was planning to use a
bool active
and convert the foreach like this:
//foreach node{
//do more stuff
startCoroutine(functionThatWaitsAndSetsActiveToFalse());
while(active)
yield return null;
}
and add a function for the tap (or any generic forceSkip)
is there a better way to do this? Cause this way if i start, let’s say 10 dialogues in 1 sec which last 10 seconds each, i’ll have 10 coroutines open for nothing