/// <summary> /// 比较cache.txt文件获取差异ab资源 /// </summary> public void CompareCacheFileGetDifferentAssetBundles(OnGetUpdateABCompleteHandel onComplete) { string cacheTxtFilePath = ABDataConfig.localABFullName + ABDataConfig.localCacheFileName;//沙盒cache文本路径 string cacheFileTxt = null; if (File.Exists(cacheTxtFilePath)) { DebugManager.LogWarning(cacheTxtFilePath + "沙盒cache文本存在!开始对比差异!"); //cacheTxtFilePath = Application.dataPath + ABDataConfig.localCacheFilePath;//本地cache文本路径 //TODO 沙盒下的应该解密读取 cacheFileTxt = File.ReadAllText(cacheTxtFilePath); } else { DebugManager.LogWarning(cacheTxtFilePath + "沙盒cache文本文件不存在!默认将服务器cache文本当做所有资源列表!"); } string serverCacheUrl = ABDataConfig.GetAssetBundleUrl + ABDataConfig.abCacheFileApiName;//服务器cache文件路径 //下载服务器cache文件 Util.DownLoadFileText(serverCacheUrl, (serverCacheString) => { serverCacheFileText = serverCacheString;//保存服务器cache文件 GetUpdateDownLoadAssetBundles(cacheFileTxt, serverCacheString); onComplete(waitDownloadAssetBundleList); }, this); }
/// <summary> /// 获取需要下载的ab资源 /// </summary> public void GetUpdateDownLoadAssetBundles(OnGetUpdateABCompleteHandel onComplete) { string serveDepUrl = ABDataConfig.GetAssetBundleUrl + ABDataConfig.abDepFileApiName;//服务器cache文件路径 //更新dep文件 AssetBundleDepFileManager.Instance.GetUpdateDownLoadDepFile(serveDepUrl, () => { //比较catch文件 CompareCacheFileGetDifferentAssetBundles(onComplete); }); }