/// <summary> /// 更新文件 /// </summary> /// <returns></returns> static IEnumerator DownLoadFile() { UpdateDateCallBack(HotUpdateStatusEnum.DownLoadingMd5File, GetHotUpdateProgress(true, false, 0)); //取得服务器版本文件 WWW www = new WWW(s_Md5FileDownLoadPath); Debug.Log("服务器获取MD5文件 :" + s_Md5FileDownLoadPath); //yield return www; while (!www.isDone) { UpdateDateCallBack(HotUpdateStatusEnum.DownLoadingMd5File, GetHotUpdateProgress(true, false, www.progress)); yield return(new WaitForEndOfFrame()); } if (www.error != null && www.error != "") { //下载失败 Debug.LogError("MD5 DownLoad Error " + www.error); UpdateDateCallBack(HotUpdateStatusEnum.Md5FileDownLoadFail, GetHotUpdateProgress(true, false, 0)); yield break; } m_Md5FileCache = ((TextAsset)www.assetBundle.mainAsset).text; www.assetBundle.Unload(true); UpdateDateCallBack(HotUpdateStatusEnum.DownLoadingMd5File, GetHotUpdateProgress(true, false, 1)); ResourcesConfigStruct serviceFileConfig = ResourcesConfigManager.AnalysisResourcesConfig2Struct(m_Md5FileCache); ResourcesConfigStruct localFileConfig = ResourcesConfigManager.AnalysisResourcesConfig2Struct(ResourcesConfigManager.ReadResourceConfigContent()); s_downLoadList = new List <ResourcesConfig>(); CheckBundleList(serviceFileConfig.relyList, localFileConfig.relyList); CheckBundleList(serviceFileConfig.bundleList, localFileConfig.bundleList); yield return(StartDownLoad()); }