When I use for into do while Unity, begin Freeze

Hey Guys !

Anyone know me say why when I use this code Unity every time is freeze ?

110455-27661897-1950983144930545-1286208725-n.png

What is wrong ?

I want that Do while will be repeating generating numbers into array until array will be passed from testing function Straight and Straight return TRUE.

Thanks so much !

Maybe Straight() is always returning false. Hard to know without looking at the code.

If that loop is an infinite loop, then Straight() is always returning false. If Straight() is not always returning false, then that loop is not infinite – either it’s merely taking a very, very long time, or a different loop is being infinite.

Consider this: if you’re randomly generating numbers into that array until it becomes a particular sequence, it may take a very very long time to reach that sequence, depending on the sequence you’re testing for.