cocos2dx在调用场景编辑器的文件时,如果没有设置触发器则程序运行正常,如果设置了触发器程序就会崩溃。
跟踪原代码发现问题出在如下地方
Ref* ObjectFactory::createObject(const std::string &name)
{
Ref *o = nullptr;
do
{
const TInfo t = _typeMap;
CC_BREAK_IF(t._fun == nullptr);
o = t._fun();
} while (0);
return o;
}
_typeMap其中name的值是PlayUIAnimation,但_typeMap集合里却找不到。不知道是什么原因。