请教关于ui编辑器中的粒子特效

在ccs里的ui编辑器中加入了CSCustomParticleWidget,放入一个粒子的plist,在ccs里粒子正常播放了,但是在运行的时候提示“Widget or WidgetReader doesn’t exists!!! Please check your json file.”,请问这是什么原因呢?

你没有注册CustomParticleWidgetReader,并把它加入到GUIReader里面去。可以参考引擎的UITest->下面的CustomGUITest:


    GUIReader* guiReader = GUIReader::getInstance();
    guiReader->registerTypeAndCallBack("CustomParticleWidget",
                                       &CustomParticleWidget::createInstance,
                                       CustomParticleWidgetReader::getInstance(),
                                       parseselector(CustomParticleWidgetReader::setProperties));
    
    CustomParticleWidget* custom = CustomParticleWidget::create();
    custom->setParticlePlist("Particles/BoilingFoam.plist");

非常感谢 :)

lua 怎么弄