public void Update(string v1, int v2, int v3, int v4) { Id = ABHelper.VersionNumCombine(v1, v2, v3, v4); IdArray = ABHelper.VersionNumSplit(Id); Id1A2 = string.Format("{0}.{1}", IdArray[0], IdArray[1]); Id1st = v1; Id2nd = v2; Id3rd = v3; Id4th = v4; }
private static void SaveTheVersion() { int num; if (!int.TryParse(TheVersionNum[3], out num)) { Debug.LogError("资源单号错误!!!!!"); } string version = ABHelper.VersionNumCombine(TheVersionNum[0], TheVersionNum[1], TheVersionNum[2], TheVersionNum[3]); ABHelper.WriteFile(Application.dataPath + "/Resources/" + ABHelper.OriginalVersionName, version); }
private static void CreatVersionTxt() { // 版号文件 string fileUrl = CreatFileUrlMd5(ABHelper.VersionNumFileName); ABHelper.WriteVersionNumFile(CurVersionABExportPath + fileUrl, ABHelper.VersionNumCombine(TheVersionNum[0], TheVersionNum[1], CurVersionNum.ToString(), TheVersionNum[3])); // ab的依赖文件 fileUrl = CreatFileUrlMd5(ABHelper.ManifestFileName); ABHelper.WriteManifestFile(CurVersionABExportPath + fileUrl, ResFolder, CurVersionManifestList); // 创建版本文件 CurVersionList = ABHelper.ReadVersionFile(PlatformABExportPath + "/" + (CurVersionNum - 1) + "/" + ABHelper.VersionFileName); List <string> filePaths = ABHelper.GetAllFilesPathInDir(CurVersionABExportPath); foreach (string path in filePaths) { if (path.EndsWith(".manifest")) { continue; } string path2 = path.Replace("\\", "/").Replace(CurVersionABExportPath, "").ToLower(); if (path2.Equals(CurVersionNum.ToString()) || path2.Equals(ABHelper.DependFileName) || path2.Equals(ABHelper.Md5FileName)) { continue; } string value = CurVersionFileUrlMd5[path2].ToLower(); if (CurVersionList.ContainsKey(value)) { CurVersionList.Remove(value); } CurVersionList.Add(value, new List <string>() { ABHelper.BuildMD5ByFile(path), CurVersionNum.ToString(), ABHelper.FileSize(path).ToString(), path2 }); } ABHelper.WriteVersionFile(CurVersionABExportPath + ABHelper.VersionFileName, CurVersionList); }