Ejemplo n.º 1
0
        /// <summary>
        /// 下载
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="sizeData"></param>
        /// <param name="finishCallBack"></param>
        public void BeginDownLoadAsset(DownLoadType type, AssetUpdateMgr parent, DownloadAssetSizeCaculate sizeData, FinishDelegate finishCallBack)
        {
            mDownloadType = type;
            mParent       = parent;
            mCurrentDownloadAssetSizeCaculate = sizeData;
            mFinishCallBack = finishCallBack;

            if (null == sizeData.mVersionDataConfig || 0 == sizeData.mVersionDataConfig.Count)
            {
                CallBackDownLoadSucess();

                return;
            }

            mNewVersionDataConfig = sizeData.mVersionDataConfig;
            mAllVersionDataDic.Clear();

            if (mDownloadType == DownLoadType.FIRST_PHASE && null != mParent)
            {
                mParent.UpdateProgress("开始下载更新资源文件", 0);
            }

            mMaxDownLoadCount = mDownloadType == DownLoadType.FIRST_PHASE ? 8 : 3;
            DownLoadAsset();
            mDownLoadAssetCount = mNewVersionDataConfig.Count;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取版本数据配置信息回调
 /// </summary>
 /// <param name="sucess"></param>
 /// <param name="dataConfig"></param>
 /// <param name="newVersionMD5"></param>
 private void OnGetNewVersionDataCallBack(bool sucess, List <AssetBundleConfig> dataConfig, string newVersionMD5)
 {
     mSizeData = new DownloadAssetSizeCaculate(dataConfig, newVersionMD5);
     mSizeData.SetDownLoadType(DownLoadType.FIRST_PHASE);
     if (sucess)
     {
         if (null != dataConfig && mSizeData.mVersionDataConfig.Count > 0)
         {
             ShowDownLoadAssetMsg();
         }
         else
         {
             ConfirmUpdate();
         }
     }
 }