The question is:
in the code you use an update method for loops and assignments:
var nextState = currentState.GetNextStates();
and a for loop that iterates with indexes of an array;
Does that mean that we are doing this every frame? Wouldn’t it be better to have something like:
if (Input.GetKeyDown(KeyCode.Alpha3))
{
nextState = currentState.GetNextStates();
if (nextState.Length > 2)
{
currentState = nextState[2];
textComponent.text = currentState.GetStateStory();
}
}
and so forth…
in this case assignments only happen when something really happens, like button presses?