Beispiel #1
0
        /// <summary>
        /// 静默后台更新所有资源
        /// </summary>
        public void BackDownloadTotalData()
        {
            Flow8ExCheckResource resource = InstanceFlow8Ex;

            if (resource.BackDownloadList != null)
            {
                for (int i = 0; i < resource.BackDownloadList.Count; i++)
                {
                    BackDownload.AddDataToPool(resource.BackDownloadList[i], DataLevel.Low);
                    _totalBaseResSize += resource.BackDownloadList[i].FileSize;
                }
            }
        }
Beispiel #2
0
        private void AddDataList(IEnumerable dataList, DataLevel level, bool append = false)
        {
            if (dataList != null && !append)
            {
                BackDownload.ClearData(level);
                if (_sceneResList.ContainsKey(level) && _sceneResList[level] != null)
                {
                    _sceneResList[level].Clear();
                }
            }
            Flow8ExCheckResource resource = InstanceFlow8Ex;
            string      fixPath           = "";
            IEnumerator enumerator        = dataList.GetEnumerator();

            while (enumerator.MoveNext())
            {
                //不存在的文件才加入到下载队列
                if (!Exist(enumerator.Current as string, out fixPath))
                {
                    lock (BackDownload.GetLocker())
                    {
                        MapFileData mapFileData = resource.GetMapFileDataByPath(fixPath);
                        if (((mapFileData == null) || mapFileData.Downloading) || mapFileData.Downloaded)
                        {
                            UpdateLog.WARN_LOG("no map data: " + fixPath);
                        }
                        else
                        {
                            mapFileData.FullPath = fixPath;
                            if (mapFileData.DataLevel > level)
                            {
                                mapFileData.DataLevel = level;
                            }
                            BackDownload.AddDataToPool(mapFileData, level);
                            //添加到当前场景资源列表,用于统计大小,显示进度
                            AddToCurSceneResList(level, mapFileData);
                        }
                    }
                }
            }
        }