IEnumerator _download_remotefile_impl(string url, OnRemoteFileDownload fileDownloaded) { WWW download = new WWW(url); yield return(download); if (string.IsNullOrEmpty(download.error) == false) { if (fileDownloaded != null) { fileDownloaded(url, download.error, null); } } else { if (fileDownloaded != null) { fileDownloaded(url, null, download.bytes); } } }
public void download_remotefile(string url, OnRemoteFileDownload fileDownloaded) { StartCoroutine(_download_remotefile_impl(url, fileDownloaded)); }