void CheckedInputKey()
    {
        for(int i = 0; i < random_sequence_images.Length;)
        {
            
            if(random_sequence_images[i].sprite == random_sequence_sprite[currentSpriteIndex])
            {
                if(Input.GetKeyDown(directionKeys[currentSpriteIndex]))
                {
                    RemoveCurrentImage();
                    currentSpriteIndex = 0;
                    i++;
                }
            }
            else
            {
                currentSpriteIndex ++;
            }
        }
    }


이게 원래 코드인데


내 생각에는 


여기서 잘보면 i가 증강하지 않는 부분이 있음.


current Index만 증가하니까 i는 계속 같은값을 가지는거지



void CheckedInputKey()

{

    for (int i = 0; i < random_sequence_images.Length;)

    {

        if (random_sequence_images[i].sprite == random_sequence_sprite[currentSpriteIndex])

        {

            if (Input.GetKeyDown(directionKeys[currentSpriteIndex]))

            {

                RemoveCurrentImage();

                currentSpriteIndex = 0;

                i++; // 이미지를 성공적으로 맞췄을 때 i를 증가시킴

            }

        }

        else

        {

            currentSpriteIndex++;

            if (currentSpriteIndex >= random_sequence_sprite.Length)

            {

                // currentSpriteIndex가 배열의 범위를 넘어가지 않도록 초기화

                currentSpriteIndex = 0;

                // i를 증가시켜 다음 이미지로 넘어가게 함

                i++;

            }

        }

    }

}


currentSpriteIndex가 배열의 길이를 넘어설때 값 0으로 초기화 했는데


일단 뭐 어떤 값을 원하는지  모르니까.


일단 무한루프는 막아봄