It looks like you're new here. If you want to get involved, click one of these buttons!
This is for c# not applicable for unity.
int userinput = (int)Console.Readkey();
//if you want another type just replace all int with that type
If you want to check for unity use the input field ui element.