|
|
@@ -6,6 +6,8 @@ using Game.Config;
|
|
|
using System;
|
|
|
using System.Reflection;
|
|
|
using System.IO;
|
|
|
+using System.IO.Compression;
|
|
|
+
|
|
|
public class CheckHotUpdateRes : EditorWindow
|
|
|
{
|
|
|
|
|
|
@@ -289,18 +291,30 @@ public class CheckHotUpdateRes : EditorWindow
|
|
|
csvWriter.Write();
|
|
|
|
|
|
CopyFile();
|
|
|
-
|
|
|
+ string FiletempPath = $"{curResInfo.OutputPath}/../ZipTempPath";
|
|
|
+ if(Directory.Exists(FiletempPath))
|
|
|
+ Directory.Delete(FiletempPath,true);
|
|
|
+ Directory.CreateDirectory(FiletempPath);
|
|
|
+ CopyFile(FiletempPath);
|
|
|
+ string zipName = $"{curResInfo.CN_Name}---{curResInfo.ResVersion}---{DateTime.Now.Month}.{DateTime.Now.Day}--1.zip";
|
|
|
+ ZipFile.CreateFromDirectory(FiletempPath,$"{curResInfo.OutputPath}/{zipName}");
|
|
|
+ Directory.Delete(FiletempPath,true);
|
|
|
needResList.Clear();
|
|
|
Debug.Log($"资源检查完成 输出路径 : 【{curResInfo.OutputPath}】");
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void CopyFile()
|
|
|
+ private void CopyFile(string outP = "")
|
|
|
{
|
|
|
if (needResList == null)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(outP))
|
|
|
+ {
|
|
|
+ outP = curResInfo.OutputPath;
|
|
|
+ }
|
|
|
int size = needResList.Count;
|
|
|
|
|
|
string datapath = $"{curResInfo.NewPath}/";
|
|
|
@@ -313,15 +327,15 @@ public class CheckHotUpdateRes : EditorWindow
|
|
|
}
|
|
|
byte[] fdatas = File.ReadAllBytes(datapath + needResList[i].FullName);
|
|
|
|
|
|
- FileHelper.WirteToFile( $"{curResInfo.OutputPath}/{needResList[i].FullName}" ,fdatas);
|
|
|
+ FileHelper.WirteToFile( $"{outP}/{needResList[i].FullName}" ,fdatas);
|
|
|
|
|
|
}
|
|
|
|
|
|
- FileHelper.WirteStringToFile($"{curResInfo.OutputPath}/{curResInfo.VersionFileName}",curResInfo.ResVersion);
|
|
|
+ FileHelper.WirteStringToFile($"{outP}/{curResInfo.VersionFileName}",curResInfo.ResVersion);
|
|
|
|
|
|
byte[] mdatas = File.ReadAllBytes(datapath + curResInfo.mainfestFileName);
|
|
|
|
|
|
- FileHelper.WirteToFile($"{curResInfo.OutputPath}/{curResInfo.mainfestFileName}", mdatas);
|
|
|
+ FileHelper.WirteToFile($"{outP}/{curResInfo.mainfestFileName}", mdatas);
|
|
|
|
|
|
}
|
|
|
|