Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private IEnumerator FetchUrl(string url)
- {
- print("Start fetching");
- WWW www = new WWW(url);
- for (int i = 0; i < TimeoutInSeconds; i++)
- {
- yield return new WaitForSeconds(1);
- if (www.isDone) break;
- }
- if (!www.isDone)
- {
- print("Timeout expired");
- www.Dispose();
- yield break;
- }
- if (!string.IsNullOrEmpty(www.error))
- {
- Debug.LogError(www.error);
- yield break;
- }
- print("Url fetched: " + www.text);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement