Archiver for Unity3D is a powerful utility for compressing and decompressing files and folders in Unity 2017.3 or later. Moreover, using the built-in mechanism, you couldn't compress a folder with its subfolders and files.
Archiver makes compressing and decompressing amazingly easy, using just two lines of code:
Archiver.Compress(source, destination); // Zip
Archiver.Decompress(source, destination); // Unzip
Where source and destination are the specified files and folders. You can run the included demo and test by yourselves.
- Build the project in
Release
mode using Visual Studio 2017 or later. - Drag and drop the
LightBuzz.Archiver.dll
into yourPlugins
folder. - In Unity, select
Edit
→Project Settings
→Other Settings
→Configuration
and set theScripting Runtime Version
to.NET 4.6
.
The archiving functionality is compatible with Unity 2017.3 or later version. The following platforms are supported:
- iOS
- macOS
- Android
- Windows Standalone (x86 and x64)
- Universal Windows Platform (UWP)
To use the Archiver, first include a reference to the assembly:
using LightBuzz.Archiver;
string source = @"C:\Users\LightBuzz\Desktop\Foo.txt";
string destination = @"C:\Users\LightBuzz\Desktop\Foo.zip";
Archiver.Compress(source, destination);
string source = @"C:\Users\LightBuzz\Desktop\Foo\";
string destination = @"C:\Users\LightBuzz\Desktop\Foo.zip";
Archiver.Compress(source, destination);
string source = @"C:\Users\LightBuzz\Desktop\Foo.zip";
string destination = @"C:\Users\LightBuzz\Desktop\Foo\";
Archiver.Compress(source, destination);
That's it!
You are free to use these libraries in personal and commercial projects by attributing the original creator. Licensed under Apache v2 License.
Do you use Archiver in your projects? Do you find it helpful? Buy us a beer!