IEnumerator DownloadProgress(string url, DownloadCallbackDelegate callback) { www = new WWW(url); if (!www.isDone) { yield return(www); } callback(www); if (sendGuilayerProgress) { GameGUI.Inst.guiLayer.SendGuiLayerProgress(name, www.progress); } www = null; Destroy(this); }
public void StartDownload(string url, DownloadCallbackDelegate callback, bool sendGuilayerProgress_ = false) { sendGuilayerProgress = sendGuilayerProgress_; StartCoroutine(DownloadProgress(url, callback)); }