[LayaAirIDE 2.0]unity导出的3D动画模型,导入 laya环境报错: node._setParent is not a function
var role3D: Laya.Sprite3D = Laya.loader.getRes("res/lk4.lh") as Laya.Sprite3D;
//加载到场景
scene.addChild(role3D); //此处报错
var ani = role3D.getComponent(Laya.Animator) as Laya.Animator;
//播放攻击状态
ani.play();
chrome 调试:
addChild(node) {
if (!node || this.destroyed || node === this)
return node;
if (node._zOrder)
this._setBit(Const.HAS_ZORDER, true);
if (node._parent === this) {
var index = this.getChildIndex(node);
if (index !== this._children.length - 1) {
this._children.splice(index, 1);
this._children.push(node);
this._childChanged();
}
}
else {
node._parent && node._parent.removeChild(node);
this._children === Node.ARRAY_EMPTY && (this._children = []);
this._children.push(node);
node._setParent(this); //在此处抛出异常
this._childChanged();
}
return node;
}
//加载到场景
scene.addChild(role3D); //此处报错
var ani = role3D.getComponent(Laya.Animator) as Laya.Animator;
//播放攻击状态
ani.play();
chrome 调试:
addChild(node) {
if (!node || this.destroyed || node === this)
return node;
if (node._zOrder)
this._setBit(Const.HAS_ZORDER, true);
if (node._parent === this) {
var index = this.getChildIndex(node);
if (index !== this._children.length - 1) {
this._children.splice(index, 1);
this._children.push(node);
this._childChanged();
}
}
else {
node._parent && node._parent.removeChild(node);
this._children === Node.ARRAY_EMPTY && (this._children = []);
this._children.push(node);
node._setParent(this); //在此处抛出异常
this._childChanged();
}
return node;
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
拾
赞同来自:
可以了给我回复下