I'm using Ionic.Zip.dll to extract a zip file from unity.
It works well with zip.ExtractAll(zipPath, ExtractExistingFileAction.OverwriteSilently);
But while the archive is extracted the UI hangs (button effects, etc...). So I tried to use this inside a coroutine but got no result, I think it's the wrong way.
Have you already extracted something in this manner ?
EDIT :
I had problems tracking completion of the threaded function because of Unity restrictions. Finally done it with a bool and a coroutine :
public bool extractionDone = false;
IEnumerator CheckLauncherExtracted() {
while(!extractionDone) yield return null;
Debug.Log("ExtractionDone done !");
OnLauncherFilesExtracted();
}
public void Extraction(){
StartCoroutine("CheckLauncherExtracted");
ThreadPool.QueueUserWorkItem(x => {
FileManager.ExtractZipToDirectory(zipPath, zipExtractPath);
extractionDone = true;
});
}