Esempio n. 1
0
        public static void ProtectedCall(IntPtr ptr, LuaCSFunction f)
        {
            int err = LuaObject.PushTry(ptr);

            LuaNativeMethods.lua_pushcfunction(ptr, f);
            if (LuaNativeMethods.lua_pcall(ptr, 0, 0, err) != 0)
            {
                LuaNativeMethods.lua_pop(ptr, 1);
            }

            LuaNativeMethods.lua_remove(ptr, err);
        }
Esempio n. 2
0
        public object Call(object a1)
        {
            int error = LuaObject.PushTry(state.StatePointer);

            LuaObject.PushVar(state.StatePointer, a1);

            if (InnerCall(1, error))
            {
                return(state.TopObjects(error - 1));
            }

            return(null);
        }
Esempio n. 3
0
        public object Call(params object[] args)
        {
            int error = LuaObject.PushTry(state.StatePointer);

            for (int n = 0; args != null && n < args.Length; n++)
            {
                LuaObject.PushVar(VariablePointer, args[n]);
            }

            if (InnerCall(args != null ? args.Length : 0, error))
            {
                return(state.TopObjects(error - 1));
            }

            return(null);
        }