原生环境粒子加载异常

 1.异常日志

Simulator: D/jswrapper (145): JS:Uncaught SyntaxError: Unexpected token } in JSON at position 2896
Simulator: D/jswrapper (145): JS:[0]loadPlist@src/jsb_polyfill.js:12719
Simulator: [1]95.Loader.handle@src/jsb_polyfill.js:12758
Simulator: [2]flow@src/jsb_polyfill.js:13223
Simulator: [3]flow@src/jsb_polyfill.js:13241
Simulator: [4]flow@src/jsb_polyfill.js:13241
Simulator: [5]99.proto.flowIn@src/jsb_polyfill.js:13296
Simulator: [6]96.proto.append@src/jsb_polyfill.js:12963
Simulator: [7]89.proto.flowInDeps@src/jsb_polyfill.js:11982
Simulator: [8]loadDepends@src/jsb_polyfill.js:13531
Simulator: [9]loadUuid@src/jsb_polyfill.js:13614
Simulator: [10]95.Loader.handle@src/jsb_polyfill.js:12758
Simulator: [11]flow@src/jsb_polyfill.js:13223
Simulator: [12]flow@src/jsb_polyfill.js:13241
Simulator: [13]anonymous@src/jsb_polyfill.js:13231
Simulator: [14]anonymous@src/jsb_polyfill.js:12273
Simulator: [15]queryAssetInfo@src/jsb_polyfill.js:16085
Simulator: [16]90.AssetLoader.handle@src/jsb_polyfill.js:12246
Simulator: [17]flow@src/jsb_polyfill.js:13223
Simulator: [18]99.proto.flowIn@src/jsb_polyfill.js:13296
Simulator: [19]96.proto.append@src/jsb_polyfill.js:12963

2.复现方式
原生环境中打开有cc.ParticleSystem组件的页面,该组件上file属性有值,并且file属性挂的粒子文件没有textureUuid的值(即没有下图中红框中的内容)
原生环境粒子加载异常_第1张图片

 

3.修复方式

编辑粒子特效时添加texture属性的值,然后重新导出该粒子文件

拓展:

原生环境粒子加载异常_第2张图片

CocosCreator中,ParticleSystem组件勾选custom时无论file属性是否有值都会按照custom下面的配置播放粒子效果。custom没有勾选时按照file挂的粒子文件播放。

推荐使用file文件播放粒子效果,有使用custom的可以直接点击其旁边的“导出”按钮导出成粒子文件(导出的文件会自动挂到ParticleSystem组件上并关闭custom)

 

你可能感兴趣的:(CocosCreator)