Simple method to extract .unitypackage files, since it seems to blow up unity on occasion and if you have lots of assets there is a good chance you just want to pull in what you need...
I tried extracting the standard asset .unitypackage files that come with Unity 5.2.3 and I was getting duplicate files. This is because there's now an 'asset.metadata' file in the .tar too:
and the .Contains("asset") check was also matching that, making two entries in var.assets that try to extract to the same path name.
Also fixes extraction exceptions not reverting to white text for the next extraction.
At first glance it also ought be possible to avoid the temp .tar file - volume seems to have a method that returns a stream. But I haven't tried that yet.
I tried extracting the standard asset .unitypackage files that come with Unity 5.2.3 and I was getting duplicate files. This is because there's now an 'asset.metadata' file in the .tar too:
and the
.Contains("asset")
check was also matching that, making two entries invar.assets
that try to extract to the same path name.Also fixes extraction exceptions not reverting to white text for the next extraction.
At first glance it also ought be possible to avoid the temp .tar file -
volume
seems to have a method that returns a stream. But I haven't tried that yet.Thanks!