12
2019
Using SharpCompress in Unity
If you need to work with zip/rar/tar/gzip packages, can use SharpCompress to handle opening or creating those files.
Compile SharpCompress DLL (unless you can find it online somewhere)
- Download project https://github.com/adamhathcock/sharpcompress
- Unzip and open in VisualStudio (i used 2017)
- Security warning, press ok
- Security warning, press ok
- View / Solution Explorer .. (if not already visible)
- Right click over SharpCompress, select Build
- Now you should have the dll in ..\sharpcompress-master\sharpcompress-master\src\SharpCompress\bin\Debug\ folder (3.5 and 4.5 versions, pick which one you like, recent unity versions support 4.5 by default, so lets pick “net45\SharpCompress.dll”)
- Copy it to your unity project, under Assets\Plugins\SharpCompress\ SharpCompress.dll
- If you are using Unity 2017.x or lower, go to Player Settings / Other settings, and enable 4.6 from “Scripting Runtime Version”
- Test creating zip package with the script below (adjust source and output folders in the script)
Source:
https://gist.github.com/unitycoder/edfc22570e93db61f83d582c98c4dff5
TroubleShooting
Error in Android build:
“NotSupportedException: ..il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\DynamicMethod.cpp(19) : Unsupported internal call for IL2CPP:DynamicMethod::create_dynamic_method – System.Reflection.Emit is not supported.
05-12 01:52:09.319 2523 2549 E Unity : at System.Reflection.Emit.DynamicMethod.CreateDynMethod ()”
Solution:
Use Mono as Scripting Backend (IL2CPP gives that error)
Related Posts
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on