Ejemplo n.º 1
0
    public static Delegate UICamera_GetTouchCallback(LuaFunction func)
    {
        if (func == null)
        {
            UICamera.GetTouchCallback fn = delegate { return(null); };
            return(fn);
        }

        UICamera.GetTouchCallback d = (new UICamera_GetTouchCallback_Event(func)).Call;
        return(d);
    }
Ejemplo n.º 2
0
 public static Delegate UICamera_GetTouchCallback(LuaFunction func)
 {
     UICamera.GetTouchCallback d = (param0) =>
     {
         int    top = func.BeginPCall();
         IntPtr L   = func.GetLuaState();
         LuaScriptMgr.Push(L, param0);
         func.PCall(top, 1);
         object[] objs = func.PopValues(top);
         func.EndPCall(top);
         return((UICamera.Touch)objs[0]);
     };
     return(d);
 }
        static internal int checkDelegate(IntPtr l, int p, out UICamera.GetTouchCallback ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, p))
            {
                ua = null;
                return(op);
            }
            else if (LuaDLL.lua_isuserdata(l, p) == 1)
            {
                ua = (UICamera.GetTouchCallback)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            if (ld.d != null)
            {
                ua = (UICamera.GetTouchCallback)ld.d;
                return(op);
            }
            LuaDLL.lua_pop(l, 1);

            l  = LuaState.get(l).L;
            ua = (int a1) =>
            {
                int error = pushTry(l);

                pushValue(l, a1);
                ld.pcall(1, error);
                UICamera.Touch ret;
                checkType(l, error + 1, out ret);
                LuaDLL.lua_settop(l, error - 1);
                return(ret);
            };
            ld.d = ua;
            return(op);
        }