code
numberOfTries = 0;
switch (level)
{
case 1:
//
password = level1Passwords[Random.Range(0,level1Passwords.Length)];
break;
case 2:
//
password = level2Passwords[Random.Range(0, level2Passwords.Length)];
break;
default:
Debug.LogError("I dont know that level");
break;
}
For demo declaring index is ok, but for less repeats just using the function within less repeats.
Is this a bad approach?