What is the difference between a wait() and sleep() in Threads? Is my understanding that a wait() -ing Thread is still in running mode and uses CPU cycles but a sleep() -ing does not consume any CPU cycles correct? Why do we have both wait() and sleep()? How does their implementation vary at a lower level?
You have the wrong mental model for working with interactive GUIs. You don't run a function and wait for input. What you do is, you run your code up to the point where the user needs to make a decision. You then update the GUI to present the user with that decision. To the buttons in that GUI, you attach event handlers. If and when the user clicks button A, you call a new, separate function ...
There are many ways to wait in Unity. They are really simple but I think it's worth covering most ways to do it: 1.With a coroutine and WaitForSeconds. This is by far the simplest way. Put all the code that you need to wait for some time in a coroutine function then you can wait with WaitForSeconds. Note that in coroutine function, you call the function with StartCoroutine(yourFunction ...
Difference between "wait ()" vs "sleep ()" in Java - Stack Overflow