[LayaAirIDE 2.0]动态添加addComponent(Laya.RigidBody)的问题
1.动态添加 this.owner.addComponent(Laya.RigidBody)后; 在调用 this.owner.removeSelf()后会抛错 : laya.core.js:13190 Uncaught 无法实例class RigidBody extends Laya.Component {...
2.但如果将Laya.RigidBody组件直接挂在预制体上,用this.owner.getComponent(Laya.RigidBody)设置后,在调用 this.owner.removeSelf()则不会抛错。
2.但如果将Laya.RigidBody组件直接挂在预制体上,用this.owner.getComponent(Laya.RigidBody)设置后,在调用 this.owner.removeSelf()则不会抛错。
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: