str = "testA()"
loadstring(str)()
function testA()
------
end
使用loadstring即可执行
后面在xlua用了下发现不能调用loadstring这个函数,听说是因为没有注册这个函数?
然后去调用lua虚拟机去调用了
CS.XLuaManager.Instance.luaenv:LoadString(str)()
这样即可
str = "testA()"
loadstring(str)()
function testA()
------
end
使用loadstring即可执行
后面在xlua用了下发现不能调用loadstring这个函数,听说是因为没有注册这个函数?
然后去调用lua虚拟机去调用了
CS.XLuaManager.Instance.luaenv:LoadString(str)()
这样即可
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。