cocostudio场景加载不了,求大神~

Scene* HelloWorld::createScene()
{
// ‘scene’ is an autorelease object
auto scene = Scene::create();

Node* myScene = SceneReader::getInstance()->createNodeWithSceneFile(“public/taskScene1.json”);
scene->addChild(myScene);

// return the scene
return scene;

}

运行弹窗口显示错误 Expression: child!=nullptr
究竟什么原因~~

是不是Reader没把场景创建出来,检查下路径

public/taskScene1.json的路径么?位置没放错~就在Resources的public里~

检查下你的Reader创建出来的是什么。

用FileUtils的fileExist检查下你的路径指向的文件存不存在。

Node* myScene = SceneReader::getInstance()->createNodeWithSceneFile(“public/taskScene1.json”);
FileUtils* a = FileUtils::getInstance();
a->isFileExist(“public/taskScene1.json”);
if (a)
{
CCLOG(“aa”);
}
结果输出aa
如果我检查程序这样无错的话就是存在啦…

bool b = a->isFileExist("public/taskScene1.json"); 
if (b) 
{ 
    CCLOG("aa"); 
} 

:881:

:10: …没输出aa…但我已经将scene editor导出文件放到resource里了…为什么找不到文件

是不是拼错了。是publish还是public

:8::8::8:我只能说…我瞎了狗眼