public void UpdateCommand() { int curIdx = _commandIdx; _commandIdx++; // 커맨드 실행에 의해 인덱스가 다시 바뀔 수 있으므로 미리 증가시켜둔다. Command command = _commands[curIdx]; // 커맨드 목록이 바뀔 수 있으므로 별도 변수에 담아둔다. command.Do(); }