private IEnumerator GetAsync(WWW www, GetCompletedEventHandler callback) { yield return(www); if (callback != null) { callback(www, www.text); } }
/// <summary> /// Retrieves data from the specified URL. /// </summary> /// <param name="url">URL</param> /// <param name="callback"> /// The method that is called to process the returned data /// when the GET operation is completed. /// </param> public void Get(string url, GetCompletedEventHandler callback) { var www = new WWW(url); StartCoroutine(GetAsync(www, callback)); }