The question is answered, right answer was accepted
Delaying The Execution Of A Method Until A Condition Is Met
I have a switch statement that will change the text of a UI text object depending on the value of a integer or string. As this is an attempt at a dialogue system, I'd like to be able to display some text to the user and then wait for them to press a button before displaying the next, preferably without using coroutines.
And what do you need our help with? We don't make scripts.
Sorry for being so vague, I needed a way to accomplish this and couldn't think of anything myself, so I hoped you guys would have an answer.
why not just use a button event to increment your dialogue index
I'll definitely try this next time I have Unity in front of me, thanks in advance.
Answer by hexagonius · Jan 25, 2016 at 07:33 PM
I would create a dialogue class, with the text and references to what the next one will be depending on which choice the user has. then have a manager with a hold of the first one, which also has a reference too the dialogue UI and which receives the clicks of the button. it then can initialize the UI with a simple call to set up the text, which buttons to show etc. on a click response it just passes that to the class which returns the next dialogue, which can be set.
This sounds excellent, as of now I've done what NickWu suggested, but I'll definitely look into this. Thank you so much.
Follow this Question
Related Questions
Image UI not enabling C# SOLVED 1 Answer
UI Text Not Updating 1 Answer
UI button issue with variable + inspector 0 Answers
How to write a script for an existing button 1 Answer
Showing a high score in the menu 1 Answer