public static void ZipRegion(int regX, int regY) { string path = string.Concat(new object[] { SceneZip.zipPath, "/", regX, "_", regY }); DirectoryInfo directoryInfo = new DirectoryInfo(path); FileInfo[] files = directoryInfo.GetFiles(); List <string> list = new List <string>(); for (int i = 0; i < files.Length; i++) { list.Add(files[i].DirectoryName + "\\" + files[i].Name); } MemoryStream memoryStream = new MemoryStream(); BinaryWriter outStream = new BinaryWriter(memoryStream); StreamZip.MultiZip(list, outStream); byte[] array = memoryStream.ToArray(); SceneZip.sceneZipWriter.Write(regX); SceneZip.sceneZipWriter.Write(regY); SceneZip.sceneZipWriter.Write(array.Length); SceneZip.sceneZipWriter.Write(array); }
public static void ZipLightmap() { string path = SceneZip.zipPath + "/Lightmap"; DirectoryInfo directoryInfo = new DirectoryInfo(path); FileInfo[] files = directoryInfo.GetFiles(); List <string> list = new List <string>(); for (int i = 0; i < files.Length; i++) { list.Add(files[i].DirectoryName + "\\" + files[i].Name); } MemoryStream memoryStream = new MemoryStream(); BinaryWriter outStream = new BinaryWriter(memoryStream); StreamZip.MultiZip(list, outStream); byte[] array = memoryStream.ToArray(); SceneZip.sceneZipWriter.Write(array.Length); SceneZip.sceneZipWriter.Write(array); }