有bug,不知道为什么一直没有修
导出lua的时候把bone name搞成type name了,type name总是相同,所以长度总是1
frameworks\cocos2d-x\cocos\scripting\lua-bindings\manual\LuaBasicConversions.h
template
void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map<std::string, T>& v)
{
lua_newtable(L);
if(nullptr == L)
return;
for (auto iter = v.begin(); iter != v.end(); ++iter)
{
std::string key = iter->first;
T obj = iter->second;
if (nullptr != dynamic_cast<cocos2d::Ref *>(obj))
{
std::string name = typeid(*obj).name();
auto typeIter = g_luaType.find(name);
if (g_luaType.end() != typeIter)
{
// lua_pushstring(L, name.c_str()); 注释这句,加上下面那句
lua_pushstring(L, key.c_str());
int ID = (obj) ? (int)obj->_ID : -1;
int* luaID = (obj) ? &obj->_luaID : NULL;
toluafix_pushusertype_ccobject(L, ID, luaID, (void*)obj,typeIter->second.c_str());
lua_rawset(L, -3);
}
}
}
}