Lists are .Net/Mono stuff, and have nothing to do with Update. A possible cause is the coroutine being started before its previous instance has finished: this lets two or more coroutines running in parallel, and changes made by a coroutine instance may be undone by another instance. Replacing Update with a coroutine usually is done this way:
function Start(): IEnumerator {
while (true){
// do stuff here
yield; // wait for next frame
}
}
Notice that only one coroutine instance is created (the Start function itself), and runs forever in an endless loop. This eliminates any possibility of multiple coroutines running at the same time, and also allocates memory only once. If you start a coroutine every frame, however, you'll get lots of coroutines running in parallel (and lots of blocks allocated in the heap). Anyway, post your Start function to show what exactly you're doing.
↧