|
I want to create a List of coroutines to start if future. How to store such functions inside a list? Say we have a function like: We cant store it inside something like `List> list` but we get compiler error like: when we call or if we use `List list` we get no compile errors but on So I wonder how to create a list to store IEnumerator functions and be capable to send its items to coutines?
(comments are locked)
|
|
Store strings! Wow, nice to know.
Aug 17 '12 at 07:40 PM
Khada
(comments are locked)
|

Read up on delegates: http://msdn.microsoft.com/en-us/library/ms173171(v=vs.80).aspx
@khada I don't see the point.
You can use delegates to hold a reference to a method. That method can contain your coroutine code and the delegates can go into a list. *Haven't done exactly this before but makes sense to me at a glance at least.
Coroutines are not exaclty methods since the compiler generate an anonymous class, so I'm not sure you can call them using delegates.
You could create a method corresponding to each coroutine that call StartCoroutine. But that sounds a bit heavy.
@Kryptos: the point is to `yield return StartCorutine(function)` s from that list one by one (so to say destroy only one asset bundle at a time)