Hi There,
I have figured out how to Parse the string value in an integer that will be stored in “int level” variable.
Maybe it is an overkill but I think it is well worth trying it.
void OnUserInput(string input)
{
if (input == "1"|| input == "2" || input == "3")
{
level = System.Int32.Parse(input);
StartGame();
}
else
{
print("bad value");
ShowMainMenu();
}
}