/// <summary> /// 检查资源更新 /// </summary> /// <param name="mono"></param> /// <param name="callBack"></param> /// <param name="parameters"></param> public void UpdataRes(LoadCloudResCallBack callBack, object[] parameters) { //if (!ResourceManager.Instance.m_LoadFormAssetBundle) //{ // callBack(true, "Test", parameters); // return; //} if (m_CanChack == true) { m_CanChack = false; m_CallBack = callBack; if (m_CoroutinesMono == null) { m_CallBack(false, "", parameters); m_CanChack = true; WDebuger.LogError("未初始化管理器,请检查!"); return; } m_Parameters = parameters; m_DownLoadFileName.Clear(); m_DownLoadFileNameItem.Clear(); m_DownLoadFileList.Clear(); string configPath = m_SavePath + ConstData.WLOCALCONFIG; if (!File.Exists(configPath)) { worldMapData.version = "1.0"; worldMapData.date = System.DateTime.Now.ToString(); if (!Directory.Exists(m_SavePath)) { Directory.CreateDirectory(m_SavePath); } m_DownLoadFileName.Add("WorldMap.json"); m_DownLoadFileNameItem.Add("WorldMap.json"); worldMapData.SaveJson(configPath); } worldMapData = WillData.LoadJson <WorldMapData>(configPath); WillFTPDownloadManager.Instance.Init(ConstData.FTPname, ConstData.FTPPassword); WillFTPDownloadManager.Instance.DownLoadData(ConstData.DownloadServerFtp + "WorldMap.json", DowlLoadConfigCallBack); } }
static void GetWorldMap() { WorldMapData worldMapData = new WorldMapData(); if (!Directory.Exists(m_ResPath)) { worldMapData.version = "1.0"; worldMapData.date = System.DateTime.Now.ToString(); Directory.CreateDirectory(m_ResPath); worldMapData.SaveJson(m_ResPath + "/" + ConstData.WLOCALCONFIG); } else { worldMapData = WillData.LoadJson <WorldMapData>(m_ResPath + "/WorldMap.json"); float current_version = float.Parse(worldMapData.version); //DirectoryInfo dir = new DirectoryInfo(m_ResPath); //dir.Delete(true); worldMapData.version = (current_version + 0.1f).ToString(); worldMapData.date = System.DateTime.Now.ToString(); Directory.CreateDirectory(m_ResPath); worldMapData.SaveJson(m_ResPath + "/" + ConstData.WLOCALCONFIG); } }