I am having issues with the following code. I want it to flash between 2 different textures... it works well for a few seconds and then starts swapping between the textures erratically. I have a similer process in another part of my game, almost identical code and it works perfectly. I have tried and tried to get this going but it's just not working. I have tried with bools, for loops (to flash a predetermined amount of times) and nothing has worked. Is there anything obvious that I have missed?
Any help gladly appreciated!!!
asked Feb 02 '12 at 05:16 AM
I belive it's time to make it an answer. It's completely normal that Unity doesn't like an empty while(true), because the processor get stuck until it hit a yield (in that case). You should do that instead :
And when you change bTextIsNotFlashing to true, affect the correct texture as well.
answered Feb 02 '12 at 03:42 PM