How to make my code stop running, until the player responses to a prompt

I have a problem. Once player presses a button, there are calculations going on, however, during that time, program, before going further with its calculations, needs to ask the player for some variables. However, if i create a prompt window and simply make it visible, once the question is required, the game will disregard the window and follow with its calculations, delivering bad results, as it lacks some variables, because player didn’t input them.

How can i make my program to wait for player to react to prompt, before continuing its work?

You probably want to use a coroutine which will wait until the user hits an “OK” button after entering those values into a window. At the end of the coroutine you would do the rest of the calculations given their input.