cocostudio动画编辑器中加入粒子效果,cocos2d3.3在播放的时候报错: The value type isn't Type::MAP
在 CCDataReaderHelper.cpp 的 1335 行加上:
此方法中 void DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, DataInfo *dataInfo)
std::string plistPath = filePath + ".plist";
std::string pngPath = filePath + ".png";
//增加下面两行就行
+ ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(dataInfo->baseFilePath + plistPath);
+ if (dict.find("particleLifespan") != dict.end()) continue;
ArmatureDataManager::getInstance()->addSpriteFrameFromFile((dataInfo->baseFilePath + plistPath).c_str(), (dataInfo->baseFilePath + pngPath).c_str(), dataInfo->filename.c_str());

本文介绍如何解决在使用Cocos2d-x 3.3版本时,加入粒子效果到cocostudio动画编辑器后出现的错误:Thevalue type isn't Type::MAP。通过修改CCDataReaderHelper.cpp文件中的特定方法,可以有效避免这一问题。
1万+

被折叠的 条评论
为什么被折叠?



