I have a method that shows a window and then returns the value of the button clicked. What I have done is that when I click the button I change a variable and then the variable will be returned. What I need is someway to pause the method until the variable has been changed.
I program a game in unity and it's using mono.
Code:
public virtual Buttons Execute(){
this.holder.SetActive(true); //Set the window active
// Here wait for the user to click a button
return clicked;//Returns the button clicked.
}