コード例 #1
0
 public new void GetText(string uri, Action <float> progress, DelGetTextCallback callback, int timeout = 0)
 {
     if (!downReqMap.ContainsKey(uri))
     {
         coroutines.Add(uri, StartCoroutine(base.GetText(uri, progress, callback, timeout)));
     }
 }
コード例 #2
0
        protected IEnumerator GetText(string uri, Action <float> progress, DelGetTextCallback callback, int timeout)
        {
            UnityWebRequest uwr = UnityWebRequest.Get(uri);

            uwr.timeout = timeout;
            uwr.SendWebRequest();
            downReqMap.Add(uri, uwr);

            yield return(getProgress(uwr, progress));

            string text = (string.IsNullOrEmpty(uwr.error)) ? uwr.downloadHandler.text : string.Empty;

            if (callback != null)
            {
                callback(uwr.error, text);
            }
            Dispose(uri);
        }