creator 3.0 编辑器版本2.4.4,节点添加组件创建失败,这到底是为什么?
控制台抛错 CCDebug.js:251 getComponent: Type must be non-nil
//init touch node
var that = this;
// 创建一个节点
var touchNode = new cc.Node();
// that.touchNode.setScale(0.07)
// 将节点添加到场景中
cc.director.getScene().addChild(touchNode);
// var type = ParticleSystem
// 添加粒子组件到 Node 上
var particle = touchNode.addComponent(cc.ParticleSystem);
// 接下去就可以对 particleSystem 这个对象进行一系列操作了
// that.particle.file = plist
particle.stopSystem()
debug进去 addcompent方法的入参为空 官方能解释下吗?项目急用!!
particle 为undefined吗?
是null
尝试过传入cc.Widget 和 cc.Sprite等参数,都正常返回;就是这个粒子cc.ParticleSystem 不行,addCompent 返回空对象,我项目中要动态添加这个ParticleSystem组件,所以就卡在这儿了
我们还没有升级到3.0,没具体用过也不太清楚。
好的谢谢,我编辑器版本是2.4.4 只有creator是3.0 ,不确定是不是版本的问题,试试再说
更换了编辑器版本2.4.3 还是不行 无语了
