Exemple #1
0
        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);
                }
            }
        }
Exemple #2
0
 public void download_remotefile(string url, OnRemoteFileDownload fileDownloaded)
 {
     StartCoroutine(_download_remotefile_impl(url, fileDownloaded));
 }