error: Failed to decompress data for the AssetBundle 可能会遇到的坑

解析assetBundle时会遇到这个无法解压的错误

Failed to decompress data for the AssetBundle

大概代码如下

using(WWW www = new WWW(assetPath+"/"+bundleName))
 {
     yield return www;
     if(!string.IsNullOrEmpty(www.error))
     {
         yield break;
     }
     var asset = www.assetBundle
     yield return null;
 }

搜了下结果很多人和我一样使用的FileZilla上传的assetBundle。解决方法是设置FileZilla传输模式为二进制类型传输。

标签: none