Hello All!
We are trying to create a small course using Unity. We have the script for it as XML. Parsed the XML and stored it. Now to present the text (conversation betwen student and teacher) , we are using two characters with speech bubbles. When we run the project, all the dialogues are getting displayed in a jiffy. We want the first text to be displayed then a delay, then the next dialogue/text.
here is the code in onGUI method
if (i < sceneArray.Length)
{
switch (sceneArray*.Type.ToString().Trim())*
{
case “presenter_text”:
//display text in speech bubble of presenter
string presenter_text = sceneArray*.SpeechText;*
DisplayText(“presenter”, presenter_text);
//Debug.Log(“switch-Inside presenter text–” + presenter_text);
//StartCoroutine(Example());
break;
case “listener_text”:
//text in student’s speech bubble
string student_text = sceneArray*.SpeechText;
DisplayText(“listener”, student_text);
//Debug.Log(“switch- listener_text—” + student_text);
_//StartCoroutine(Example());
break;
} //switch case ends here*_
} //if ends here
i++;
I have tried a lot but in all places the say onGUI cannot be delayed. I tried many methods but none are working. there are no errors. it is just that the text in the text boxes gets displayed and finishes the conversation in a second. I printed all the texts to console to see all is well on that side.
Our team is stuck with this since a day. Any help will be greatly appreciated.