public static LuaFunction ToLuaFunction(IntPtr L, int stackPos) { stackPos = LuaDLL.abs_index(L, stackPos); LuaDLL.lua_pushvalue(L, stackPos); int reference = LuaDLL.toluaL_ref(L); return(LuaStatic.GetFunction(L, reference)); }
public static LuaFunction ToLuaFunction(IntPtr L, int stackPos) { LuaTypes luaTypes = LuaDLL.lua_type(L, stackPos); if (luaTypes == LuaTypes.LUA_TNIL) { return(null); } LuaDLL.lua_pushvalue(L, stackPos); int reference = LuaDLL.toluaL_ref(L); return(LuaStatic.GetFunction(L, reference)); }