Call a coroutine from a list multiple times
I have something like:
List< IEnumerator> list=new List< IEnumerator>();
list.Add(somecoroutine);
Then i call it: StarCoroutine(list[0]);
But if i call it again it wont work. Is it possible to store and call this same coroutine with the same parameters multiple times?
Comment
I think this does not work because you're reusing that same IEnumerator, which has finished already. You could replace the list type by a System.Func and Add the whole function. Haven't tried but I think should work
Thanks for helping!
i tried this:
List< Func< IEnumerator>> list = new List< Func< IEnumerator>>();
list.Add(somecoroutine);
StarCoroutine(list[0]());
and it worked multiple times, but i can't use it if the IEnumerator has parameters.