Files
test-all/lua-test/lua/script/2/test2.lua
2024-10-10 19:21:07 +08:00

34 lines
841 B
Lua

--- table 操作
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by wxdgaming.
--- DateTime: 2024/8/28 17:30
---
function t3(str)
print("lua 接收 java 传递参数 - " .. tostring(str))
javaT3("我是 lua")
return str
end
function testNow(map)
argsTest(1, "3")
print(" lua now - " .. ret(map))
print(" lua now - " .. ret(map["now"]))
print(" lua nowsec - " .. ret(map["nowsec"]))
print("lua math.ceil - " .. ret(math.ceil(map["now"] / 1000)))
end
function argsTest(...)
gameDebug.assertTrue(1 == 2, "参数异常", ...)
end
function ret(obj)
local success, ret = pcall(function()
return "dd - " .. obj
end)
if not success then
local var = gameDebug.toStrings(obj, true)
print(debug.traceback(var .. ret), 1)
end
return ret
end