示例#1
0
        public override void Uninitialize()
        {
            if (MapFileDataListForDownload != null)
            {
                MapFileDataListForDownload.Clear();
            }

            if (_parsedMapDataList != null)
            {
                _parsedMapDataList.Clear();
            }
        }
示例#2
0
        //解析本地所有的map文件
        private int parseMapFiles()
        {
            UpdateLog.DEBUG_LOG("解析map文件+++");
            int ret = CodeDefine.RET_SUCCESS;

            MapFileDataListForDownload.Clear();
            _parsedMapDataList.Clear();

            string resUrl = "";

            for (int i = 0; i < _currentData.VersionModelBaseList.Count; i++)
            {
                VersionModel mapModel = _currentData.VersionModelBaseList[i];

                //分段版本比本地分段更大,则跳过解析,本地可能没有
                if (LocalXml.BaseResVersion.CompareTo(mapModel.ToVersion.Replace("。", ".")) < 0)
                {
                    continue;
                }

                string mapUrl  = mapModel.Map_url.Replace("\\", "/");
                string mapName = mapUrl.Substring(mapUrl.LastIndexOf("/") + 1);
                UnityEngine.Debug.Log("mapName:" + mapName);
                string localMapFile = System.IO.Path.Combine(_storeDir, mapName);
                resUrl = mapModel.ResourceUrl;
                MapFileManage mapManager = new MapFileManage();
                ret = mapManager.parseMapFile(localMapFile, mapModel.ResourceUrl, _storeDir);

                if (ret <= CodeDefine.RET_FAIL)
                {
                    return(ret);
                }

                _parsedMapDataList.AddRange(mapManager.GetMapFileDataList());
            }

            UpdateLog.DEBUG_LOG("解析map文件---");
            return(ret);
        }