The same code is used to adjust the value of a money counter in another similar IENumerator so it works and it is not the issue of the code itself.
It's something with the UIProgressbar. When I put debug info, it's clear the "for" cycle is executed only once for some unknown reason (instead of 20 times).
Title: Re: UIProgressbar.value and Yield don't work together?!
Post by: ArenMook on December 30, 2014, 02:32:07 PM
How do you launch this coroutine? You need to explicitly start it. There are no issues updating a progress bar from a coroutine.
Title: Re: UIProgressbar.value and Yield don't work together?!
Post by: Biggix on December 30, 2014, 10:59:41 PM
I found out that it's not NGUI, it's some strange Unity behaviour. Under certain conditions, Unity stops a coroutine upon the very first yeild. I can't define a pattern on when this happens but I already encountered this twice. Had to do a workaround both times.
Title: Re: UIProgressbar.value and Yield don't work together?!
Post by: ArenMook on December 31, 2014, 03:57:45 PM
Oh yeah, I've ran into that obscure issue once too... if you can figure out what causes it to happen, I'd love to know.