lua输入函数名字符串执行函数

str = "testA()"
loadstring(str)()

function testA()
------
end

使用loadstring即可执行
后面在xlua用了下发现不能调用loadstring这个函数,听说是因为没有注册这个函数?
然后去调用lua虚拟机去调用了
CS.XLuaManager.Instance.luaenv:LoadString(str)()
这样即可
posted @ 2018-03-17 09:37  三页菌  阅读(2892)  评论(0编辑  收藏  举报