int result = 0; if (LuaAPI.lua_isinteger(L, 1)) { result = (int)LuaAPI.lua_toint64(L, 1); }
long value = Lua.lua_toint64(L, -1);In this example, we are assuming that the Lua stack contains a single value, and we are retrieving that value as a 64-bit signed integer using the lua_toint64 function. The UniLua package library is the set of APIs provided by UniLua, which includes lua_toint64 as well as many other Lua/C# integration functions.