Hello I am taking the unity 2d course from udemy and I’ve got a doubt from the text 101 game. I don’t understand how the following code works.
for (int index = 0; index < nextStates.Length;index ++;)
{
if (Input.GetKeyDown(KeyCode.Alpha1 + index))
{
state = nextStates[index];
}
}
Please explain