[LayaAir 2.0]释放资源报错

释放unity导入的骨骼动画模型时报错
laya.d3.js:41972 Uncaught TypeError: Cannot read property 'off' of null
    at SkinnedMeshRenderer.__proto._destroy (laya.d3.js:41972)
    at SkinnedMeshSprite3D.__proto.destroy (laya.d3.js:34884)
    at SkinnedMeshSprite3D.__proto.destroy (laya.d3.js:43737)
 
发现
 
        if (this._cacheRootBone){
            this._cacheRootBone.transform.off(/*laya.events.Event.TRANSFORM_CHANGED*/"transformchanged",this,this._boundChange);
这里的this._cacheRootBone非空,但是上面transform是空的
 
这个精灵是 SkinnedMeshRenderer绑定的RootBone的对象。
 
下面是.lm文件
{
"type":"SkinnedMeshSprite3D",
"instanceID":74,
"props":{
"name":"胳膊节点001",
"active":true,
"isStatic":false,
"layer":16,
"position":[
0,
-0.1193539,
-5.217125E-09
],
"rotation":[
-0.7071068,
0,
0,
-0.7071068
],
"scale":[
-0.1805366,
-0.1261967,
-0.1261967
],
"rootBone":52,
"boundBox":{
"min":[
-0.330108,
-0.5589796,
-0.68723
],
"max":[
0.6775162,
0.1249337,
0.06879723
]
},
"boundSphere":{
"center":[
0.1737041,
-0.217023,
-0.3092164
],
"radius":0.7166975
},
"bones":[
56,
57,
58,
52,
53,
54
],
"materials":[
{
"type":"Laya.BlinnPhongMaterial",
"path":"Assets/MainGame/Scripts/lmh/Shader/shoubiMat.lmat"
}
],
"meshPath":"Assets/MainGame/Art/NewGuns/HaveCaiZhi/C9-胳膊节点001.lm"
},
"components":,
"child":
}
 
 
 
 
 
 
 
QQ图片20191015185903.png
已邀请:

小程序KID

赞同来自:

我用的是LayaAir2.2.0,2.2.0修改过这个地方,是没有改好还是我的版本不对?

要回复问题请先

商务合作
商务合作