public static void SetEnvironment(LuaFuncRef Func, LuaReference Env) { Func.GetRef(); Env.GetRef(); LL.lua_setfenv(L, -2); LL.lua_pop(L, 1); }
static void Run(LuaFuncRef FuncRef, int ReturnValues, object[] Args) { FuncRef.GetRef(); for (int i = 0; i < Args.Length; i++) { Advanced.Push(L, Args[i]); } if (LL.lua_pcall(L, Args.Length, ReturnValues, 0) != 0) { throw new Exception(LL.lua_tostring(L, -1)); } }
public static LuaReference GetEnvironment(LuaFuncRef Func) { Func.GetRef(); LL.lua_getfenv(L, -1); return(new LuaReference(L)); }