-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [1.3.5-preview] - 2024-01-09 ### Added * doc: add "How to Use" section * doc: add Installation page
- Loading branch information
Unity Technologies
committed
Jan 9, 2024
1 parent
d54975c
commit f5606a1
Showing
7 changed files
with
126 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Installation | ||
|
||
Follow the following steps to install `com.unity.sharp-zip-lib` package: | ||
|
||
1. Make sure git is installed in the system. | ||
1. Open [Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) | ||
1. Click the **+** button, and choose **Add package from git URL** | ||
![](images/PackageManager.png) | ||
1. Type in `com.unity.sharp-zip-lib` and click **Add**. | ||
We can also specify a particular version by appending `@<version>`, for example: `[email protected]` | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* [SharpZipLib](index.md) | ||
* [Installation](Installation.md) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,58 @@ | ||
# com.unity.sharp-zip-lib | ||
|
||
`com.unity.sharp-zip-lib` is a package that wraps [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) to be used inside Unity, | ||
and provides various compression/extraction utility functions. | ||
and provides various compression/uncompression utility functions. | ||
|
||
Currently, this packages uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1). | ||
Currently, this package uses [SharpZipLib v1.3.1](https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.1). | ||
Please refer to the [installation](Installation.md) page to install this package. | ||
|
||
> The version numbering of this package itself and the version of SharpZipLib used in the package may look similar, | ||
but they are not related. | ||
|
||
|
||
## How to Use | ||
|
||
* All [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) APIs are available under `Unity.SharpZipLib` namespace. For example: | ||
```csharp | ||
using System.IO; | ||
using Unity.SharpZipLib.GZip; | ||
|
||
... | ||
|
||
public void Foo() { | ||
MemoryStream ms = new MemoryStream(); | ||
GZipOutputStream outStream = new GZipOutputStream(ms); | ||
... | ||
} | ||
|
||
``` | ||
|
||
Please refer to the API documentation of the [SharpZipLib](https://github.com/icsharpcode/SharpZipLib) version used | ||
in this package for more details. | ||
|
||
* In addition, `com.unity.sharp-zip-lib` also provides additional utility APIs: | ||
* `ZipUtility.CompressFolderToZip()`: Compresses the files in the nominated folder, and creates a zip file on disk. | ||
* `ZipUtility.UncompressFromZip()`: Uncompress the contents of a zip file into the specified folder. | ||
|
||
As an example: | ||
```csharp | ||
|
||
[Test] | ||
public void Foo() { | ||
//Compress | ||
string tempZipPath = FileUtil.GetUniqueTempPathInProject(); | ||
string folderToCompress ="Bar"; | ||
ZipUtility.CompressFolderToZip(tempZipPath,null, folderToCompress); | ||
|
||
//Uncompress | ||
string tempExtractPath = FileUtil.GetUniqueTempPathInProject(); | ||
Directory.CreateDirectory(tempExtractPath); | ||
ZipUtility.UncompressFromZip(tempZipPath, null, tempExtractPath); | ||
|
||
} | ||
``` | ||
|
||
|
||
## Supported Unity Versions | ||
|
||
* Unity `2018.4.36` or higher. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,22 @@ | |
"displayName": "SharpZipLib", | ||
"name": "com.unity.sharp-zip-lib", | ||
"unity": "2018.4", | ||
"version": "1.3.4-preview", | ||
"version": "1.3.5-preview", | ||
"dependencies": {}, | ||
"description": "A package that wraps SharpZipLib (https://github.com/icsharpcode/SharpZipLib) to be used inside Unity", | ||
"contributors": [ | ||
"Sindharta Tanuwijaya <[email protected]> (https://github.com/sindharta)" | ||
], | ||
"_upm": { | ||
"changelog": "### Added\n* internal: analytics" | ||
"changelog": "### Added\n* doc: add \"How to Use\" section\n* doc: add Installation page" | ||
}, | ||
"upmCi": { | ||
"footprint": "e465b74e38c1e8ee006b84c4e09831805e4443c9" | ||
"footprint": "df804c9234c1ba5e98093a0b6292417aafb38b90" | ||
}, | ||
"documentationUrl": "https://docs.unity3d.com/Packages/[email protected]/manual/index.html", | ||
"repository": { | ||
"url": "https://github.com/Unity-Technologies/SharpZipLib.git", | ||
"type": "git", | ||
"revision": "2365f2b7a8ab263a891a9932f7d53d465133b59d" | ||
"revision": "9fc656c1c2a19eed9b5f26574dbb06023f47773b" | ||
} | ||
} |