-
Creator 版本: 3.8.1
-
目标平台: chrome浏览器
-
重现方式:
用代码动态替换骨骼动画资源,当这个sp.Skeleton所在的节点或者父节点active为false时,必然会报错
let skeleton = target.getComponent(sp.Skeleton);if (!skeleton) { console.error("The node doesn't have a Skeleton component."); return; } skeleton.skeletonData = spineData; // skeleton.animation = animation; skeleton.premultipliedAlpha = premultipliedAlpha; // skeleton.loop = loop; skeleton.clearTracks(); skeleton.setAnimation(trackIndex, animation, loop);
报错信息
index.js:1 ErrorEvent
(anonymous) @ index.js:1
skeleton.ts:837 Uncaught TypeError: Cannot read properties of null (reading ‘data’)
at Skeleton.setAnimation (skeleton.ts:837:42)
at Object.onComplete (SpriteLoader.ts:54:22)
at completeCallback (ResMgr.ts:79:45)
at utilities.ts:310:13
at misc.ts:169:13
at handleRAF (utils.ts:212:21)
-
首个报错:
-
之前哪个版本是正常的:
-
手机型号:
-
手机浏览器:
-
编辑器操作系统:
-
重现概率:

