Exemplo n.º 1
0
    private IEnumerator GetAsync(WWW www, GetCompletedEventHandler callback)
    {
        yield return(www);

        if (callback != null)
        {
            callback(www, www.text);
        }
    }
Exemplo n.º 2
0
    /// <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));
    }