void DownloadPlaying() { DownloadPlayingStageDataFactory strategyFactory = new DownloadPlayingStageDataFactory(); StageDataBase[] strategyBases = strategyFactory.BuildStrategys(); if (strategyBases == null || strategyBases.Length <= 0) { return; } Debug.Log("边玩边下载包=" + strategyBases.Length); ResourcesDownLoad zipDownload = new ResourcesDownLoad(strategyBases); zipDownload.StartDownLoad(); if (_first_view != null) { GUIS.Remove(_first_view); _first_view = null; } new PackageDownLoadView(zipDownload); zipDownload.DownLoadCompleteEvent = (rt) => { Updates.Clear(); GUIS.Clear(); AssetDownLoads.Clear(); }; }
void StartZipDownLoad() { _file_downLoad.DownLoadCompleteEvent = (dl) => { AssetBundleManifestDownLoad manifestDownLoad = new AssetBundleManifestDownLoad(); manifestDownLoad.StartDownLoad(); manifestDownLoad.DownLoadCompleteEvent = (rt) => { FirstPackageStageDataFactory zipDownloadStragegy = new FirstPackageStageDataFactory(); StageDataBase[] strategyBases = zipDownloadStragegy.BuildStrategys(); if (strategyBases != null && strategyBases.Length > 0) //含有边玩边下载 { Debug.Log("边玩边下载首包=" + strategyBases.Length); ResourcesDownLoad firstDownload = new ResourcesDownLoad(strategyBases); firstDownload.DownLoadCompleteEvent = FristPackage; firstDownload.StartDownLoad(); _first_view = new PackageDownLoadView(firstDownload); } else { FristPackage(null); } }; }; }
public PackageDownLoadView(ResourcesDownLoad downLoadBase) { Updates.Add(this); GUIS.Add(this); this.downLoadBase = downLoadBase; DownLoadStageResult = UpdateStageResult.DownLoad; CompressionStageResult = UpdateStageResult.Compression; resourcesUpdate = Managers.ResourcesUpdate; }