[C#] yield instruction in function with return value

I would like to create a function which returns a value based on some user choices (clicks on GUI buttons).

Is it possible to do this?
The function should be something like

int getUserChoice(){
/*
  * When the user finishes clicking on the GUI buttons, another thread
  * sets the user choice to its actual value. Until then its value is -1.
*/
    userChoice = -1;
    displayAvailableChoices();
    while(userChoice < 0)
        yield return WaitForFixedUpdate();
    return userChoice;
}

The problem is that I can’t use the yield statement because the function is not a “IEnumerator”.
Is there any way I can do this?
It’s not like I cannot have a callback function, but this would simplify A LOT my classes (because of polymorphism).
Thank you in advance :slight_smile:

P.S.
The code is not actually this one, it’s a lot more complicated, but you get the idea :wink:

Unfortunately you can’t return from a function that uses yield as that routine will execute over a period of time and it would make your code block. You could pass a delegate to call when the fixedupdate is done or implement the choice at that point.