Example #1
0
 public static Delegate UICamera_GetTouchCountCallback(LuaFunction func)
 {
     UICamera.GetTouchCountCallback d = () =>
     {
         object[] objs = func.Call();
         return((int)objs[0]);
     };
     return(d);
 }
Example #2
0
    public static Delegate UICamera_GetTouchCountCallback(LuaFunction func)
    {
        if (func == null)
        {
            UICamera.GetTouchCountCallback fn = delegate { return(0); };
            return(fn);
        }

        UICamera.GetTouchCountCallback d = (new UICamera_GetTouchCountCallback_Event(func)).Call;
        return(d);
    }
        static internal int checkDelegate(IntPtr l, int p, out UICamera.GetTouchCountCallback 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.GetTouchCountCallback)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

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

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

                ld.pcall(0, error);
                int ret;
                checkType(l, error + 1, out ret);
                LuaDLL.lua_settop(l, error - 1);
                return(ret);
            };
            ld.d = ua;
            return(op);
        }