Exemplo n.º 1
0
            public int Call(ILuaState lua)
            {
                const int firstParamPos = 3;
                int       n             = lua.GetTop();
                object    inst          = lua.ToUserData(2);
                int       nparam        = n - firstParamPos + 1;

                object[] parameters = new object[nparam];
                for (int i = 0; i < nparam; ++i)
                {
                    int  index   = firstParamPos + i;
                    Type partype = ParameterTypes[i];
                    parameters[i] = LuaStackUtil.ToRawValue(lua, index, partype);
                }

                object r = Method.Invoke(inst, parameters);

                return(PushReturnValue(lua, r));
            }
Exemplo n.º 2
0
 protected override int PushReturnValue(ILuaState lua, object o)
 {
     return(LuaStackUtil.PushRawValue(lua, o, ReturnType));
 }