2using System.Collections;
3using System.Collections.Generic;
9using ICSharpCode.SharpZipLib.Zip;
10using NaughtyAttributes;
21 using (ZipOutputStream OutputStream =
new ZipOutputStream(
File.Create(file +
".zip")))
24 OutputStream.SetLevel(8);
26 byte[] buffer =
new byte[4096];
28 ZipEntry entry =
new ZipEntry(Path.GetFileName(file));
32 entry.DateTime = DateTime.Now;
33 OutputStream.PutNextEntry(entry);
35 using (FileStream fs =
File.OpenRead(file))
43 sourceBytes = fs.Read(buffer, 0, buffer.Length);
44 OutputStream.Write(buffer, 0, sourceBytes);
45 }
while (sourceBytes > 0);
50 OutputStream.Finish();
59 Debug.LogError($
"Exception during processing {ex}");
65 FastZip fastZip =
new FastZip();
66 fastZip.ExtractZip(file, Path.GetDirectoryName(file),
null);
72 Compress(
@"E:\Munka\vrtanoda\Assets\StreamingAssets\cube.fbx");
77 Decompress(
@"E:\Munka\vrtanoda\Assets\StreamingAssets\cube.fbx.zip");
UnityEngine.UI.Button Button
void Decompress(string file)
void Compress(string file)