加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cocos2d html5 3.8.1 .修复Cocos2d Particle Builder plist 粒子

发布时间:2020-12-14 16:42:41 所属栏目:百科 来源:网络整理
导读:plist 粒子是 Cocos2d Particle Builder 生成的 cocos2dx 版本 3.8.1 路径 frameworkscocos2d-html5cocos2dcompressionZipUtils.js 文件名称 ZipUtils.js .js 已修改 13 删除 1 以下是补丁. diff --git a/frameworks/cocos2d-html5/cocos2d/compression/

plist 粒子是 Cocos2d Particle Builder 生成的

cocos2dx 版本 3.8.1


路径
frameworkscocos2d-html5cocos2dcompressionZipUtils.js

文件名称

ZipUtils.js.js

已修改 13

删除 1


以下是补丁.


diff --git a/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js b/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js
index ccecd63..8288b98 100644
--- a/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js
+++ b/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js
@@ -25,7 +25,19 @@ cc.unzip = function () {
 */
cc.unzipBase64 = function () {
  var tmpInput = cc.Codec.Base64.decode.apply(cc.Codec.Base64,arguments);
-  return  cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,[tmpInput]);
+  var ret;
+  try{
+    ret = cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,[tmpInput]);
+  }
+  catch(e){
+    console.log('unzip base64 error try again');
+    if(tmpInput.length>8){
+      tmpInput = tmpInput.slice(7,tmpInput.length);
+      ret = tmpInput;
+    }
+  }
+
+  return ret;
};

/**



希望有帮助

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读