public static void SaveInEditor(this ABVersion rVersion, string rOutPath) { if (rVersion == null) { return; } string rVersionBinPath = Path.Combine(rOutPath, ABVersion.ABVersion_File_Bin); string rVersionJsonPath = Path.Combine(rOutPath, ABVersion.ABVersion_File_Json); string rVersionMD5Path = Path.Combine(rOutPath, ABVersion.ABVersion_File_MD5); using (FileStream fs = new FileStream(rVersionBinPath, FileMode.Create)) { using (BinaryWriter bw = new BinaryWriter(fs)) { rVersion.Serialize(bw); } } JsonNode rJsonNode = JsonParser.ToJsonNode(rVersion); File.WriteAllText(rVersionJsonPath, rJsonNode.ToString()); string rVersionMD5 = UtilTool.GetMD5(rVersionBinPath).ToHEXString(); File.WriteAllText(rVersionMD5Path, rVersionMD5); AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); }
public static string GetMD5ForABVersion(string rOutPath) { string rVersionMD5Path = Path.Combine(rOutPath, ABVersion.ABVersion_File_Bin); if (!File.Exists(rVersionMD5Path)) { return(string.Empty); } return(UtilTool.GetMD5(rVersionMD5Path).ToHEXString()); }