/// <summary> /// 远程ab包信息列表 /// </summary> public List <ABInfo> GetAseetBundleList(string version) { using (var webClient = new WebClient()) { Stream stream = webClient.OpenRead(string.Format("{0}?Version={1}", setting.RemoteAssetBundleListURI, version)); StreamReader sr = new StreamReader(stream); return(ABUtility.JsonToABList(sr.ReadToEnd())); } }
/// <summary> /// 异步下载ab包 /// </summary> private void Download() { var abUri = GetABDownloadUri(CurrentDownloadItem); var abPath = ABUtility.TryCreateDirectory(CurrentDownloadItem, localAssetBundlePath); using (var webClient = new WebClient()) { webClient.DownloadFileCompleted += ABDownloadCompleted; webClient.DownloadProgressChanged += ABDownlaodProgressChanged; webClient.DownloadFileAsync(abUri, abPath); } }