CocoStudio 1.6,Cocos2d-x 3.4
发现一个坑,场景编辑器使用整图编辑出来的资源无法正常读取,跟踪代码查找出原因在于CCComRender.cpp文件中不管是否使用了plist文件都会去获取碎图的全路径,而使用plist加载的整图根本获取不到每张碎图的全路径,而全路径获取失败都会返回空字符串,因此会加载失败,相关代码如下(CCComRender.cpp第141-144行):
if (file != nullptr)
{
filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file));
}
不知增加如下的判断
if (file != nullptr)
{
if (plist == nullptr) {
filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file));
} else {
filePath.assign(file);
}
}
是否可行,会不会对其他方式的资源读取加载有影响。