Exemplo n.º 1
0
    public static Delegate UICamera_GetKeyStateFunc(LuaFunction func)
    {
        if (func == null)
        {
            UICamera.GetKeyStateFunc fn = delegate { return(false); };
            return(fn);
        }

        UICamera.GetKeyStateFunc d = (new UICamera_GetKeyStateFunc_Event(func)).Call;
        return(d);
    }
Exemplo n.º 2
0
 public static Delegate UICamera_GetKeyStateFunc(LuaFunction func)
 {
     UICamera.GetKeyStateFunc 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((bool)objs[0]);
     };
     return(d);
 }
        static internal int checkDelegate(IntPtr l, int p, out UICamera.GetKeyStateFunc 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.GetKeyStateFunc)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

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

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

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