- Home /
How to imitate yield functionality like WWW class
Hi guys,
I'd like to write a class that can act the same as WWW in its ability to pop back into processing once it has done it's deed by yielding the instance itself.
So I want to do the exact same as:
WWW w = new WWW("no matter");
yield return w; // Wait for instance
(I wish to use my own class instead of WWW)
And not:
Tesy1 t = new Test1("no matter");
yield return StartCoroutine(t.someMethod); // wait for method in instance
How would I go about doing that?
Thanks.
Comment
I haven't tried this myself, not even considered it, but from a language perspective I would assume it will involve implementing the IEnumerable interface in your class.
I note that they don't seem to implement it in WWW though so maybe they do it a different way :s
Your answer
Follow this Question
Related Questions
yield on a www never completes 10 Answers
Yielding with WWW in Editor 9 Answers
Can I use WWW in Start()? 1 Answer