help:how to response yield return in WWW

I want to repack WWW class like this:

using System.Collections;
public class WWW {
UnityEngine.WWW w;

public WWW(string url)
{
w=new UnityEngine.WWW(url);
}
//…
}

Then:

WWW w=new WWW(“http://www.baidu.com/”);
yield return w; //But,How to response yield in WWW.

//I’m sorry for my bad English

I understand what you are trying accomplish: you want to use yield return but from within the class not inheriting the MonoBehaviour class.

Don’t do that! It’s very hard to maintain this kind of code nested within your custom classes (been there - done that).

My suggestion is to have s single “download manager” which is based on MonoBehaviour and is called from your code. It should internally keep the list of WWWs he’s monitoring.

FYI I’ve implemented such a mechanism in eDriven (free and open-source framework), so you might choose to use that instead - what you get is a nice written code having a callback syntax.