Well, then, let me show me a neat way to do this!
Here we make an IEnumerator that takes an action (a method in our case) as a parameter and calls it when our WWW is executed:
public static IEnumerator GetSomething(Action<string> callback)
{
WWWForm wwwForm = new WWWForm();
wwwForm.AddField("select", "something");
WWW www = new WWW(URL, wwwForm);
yield return www;
if (www.error == null)
{
callback(www.text);
}
else
{
callback("Error");
}
}
And here is how we use it:
StartCoroutine(
GetSomething((text) =>
{
if (text != "Error")
{
}
else
{
}
})
);
, , (text), . " " IEnumerator, -, , , , GetSomething.