public void DownloadAsset(IWWWAsync receiver, string url, System.Type type) { if (!mDownloadedObjects.ContainsKey(url)) { // Add to the downloading list if (!mDownloadingAssets.ContainsKey(url)) { List <IWWWAsync> receivers = new List <IWWWAsync>(); receivers.Add(receiver); mDownloadingAssets.Add(url, receivers); GameObject newDownload = new GameObject(url); WWWDownload wwwDownload = newDownload.AddComponent <WWWDownload> (); wwwDownload.StartDownload(receiver, url, type); } else { List <IWWWAsync> receivers = mDownloadingAssets[url]; receivers.Add(receiver); mDownloadingAssets[url] = receivers; } } else { // Get it from the cache receiver.AsyncUpdate(DownloadState.COMPLETED, mDownloadedObjects[url], null); } }
public void StartDownload(IWWWAsync receiver, string url, System.Type type) { mType = type; mReceiver = receiver; mURL = url; StartCoroutine(StartDownload()); }
public static void DownloadAsset(IWWWAsync receiver, string url, System.Type type) { WWWAsync wwwAsync = new WWWAsync(); wwwAsync.DownloadAsset(receiver, url, type); }