Пример #1
0
    IEnumerator ILoadText(string url, LoadTextAction action)
    {
        WWW www = new WWW(url);

        yield return(www);

        if (!string.IsNullOrEmpty(www.error))
        {
            Debug.Log("www.error" + www.error);
            yield break;
        }
        action(www.text);
        www.Dispose();
    }
Пример #2
0
 public void LoadText(string url, LoadTextAction action)
 {
     StartCoroutine(ILoadText(url, action));
 }