I enjoyed using If statements more then switch honestly.
bool isValidLevelNumber = (input == “1” || input == “2”);
if(isValidLevelNumber)
{
level = int.Parse(input);
StartGame();
}
if (input == “1”)
{
password = level1Password[Mathf.FloorToInt(Random.Range(0, level1Password.Length))];
//password = level1Password[2];
StartGame();
}
else if (input == “2”)
{
password = level2Password[Mathf.FloorToInt(Random.Range(0, level2Password.Length))];
StartGame();
}
This worked well for me.