Exemplo n.º 1
0
    static int set_lowMemory(IntPtr L)
    {
        try
        {
            EventObject arg0 = null;

            if (LuaDLL.lua_isuserdata(L, 2) != 0)
            {
                arg0 = (EventObject)ToLua.ToObject(L, 2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "The event 'UnityEngine.Application.lowMemory' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.Application'"));
            }

            if (arg0.op == EventOp.Add)
            {
                UnityEngine.Application.LowMemoryCallback ev = (UnityEngine.Application.LowMemoryCallback)arg0.func;
                UnityEngine.Application.lowMemory += ev;
            }
            else if (arg0.op == EventOp.Sub)
            {
                UnityEngine.Application.LowMemoryCallback ev = (UnityEngine.Application.LowMemoryCallback)arg0.func;
                UnityEngine.Application.lowMemory -= ev;
            }

            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 2
0
        static int _e_lowMemory(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                int __gen_param_count       = LuaAPI.lua_gettop(L);
                UnityEngine.Application.LowMemoryCallback __gen_delegate = translator.GetDelegate <UnityEngine.Application.LowMemoryCallback>(L, 2);
                if (__gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#2 need UnityEngine.Application.LowMemoryCallback!"));
                }


                if (__gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+"))
                {
                    UnityEngine.Application.lowMemory += __gen_delegate;
                    return(0);
                }


                if (__gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-"))
                {
                    UnityEngine.Application.lowMemory -= __gen_delegate;
                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Application.lowMemory!"));
        }
        static internal int checkDelegate(IntPtr l, int p, out UnityEngine.Application.LowMemoryCallback 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 = (UnityEngine.Application.LowMemoryCallback)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

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

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

                ld.pcall(0, error);
                LuaDLL.lua_settop(l, error - 1);
            };
            ld.d = ua;
            return(op);
        }
Exemplo n.º 4
0
    static int QPYX_set_lowMemory_YXQP(IntPtr L_YXQP)
    {
        try
        {
            EventObject QPYX_arg0_YXQP = null;
            if (LuaDLL.lua_isuserdata(L_YXQP, 2) != 0)
            {
                QPYX_arg0_YXQP = (EventObject)ToLua.ToObject(L_YXQP, 2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L_YXQP, "The event 'UnityEngine.Application.lowMemory' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.Application'"));
            }

            if (QPYX_arg0_YXQP.op == EventOp.Add)
            {
                UnityEngine.Application.LowMemoryCallback QPYX_ev_YXQP = (UnityEngine.Application.LowMemoryCallback)QPYX_arg0_YXQP.func;
                UnityEngine.Application.lowMemory += QPYX_ev_YXQP;
            }
            else if (QPYX_arg0_YXQP.op == EventOp.Sub)
            {
                UnityEngine.Application.LowMemoryCallback QPYX_ev_YXQP = (UnityEngine.Application.LowMemoryCallback)QPYX_arg0_YXQP.func;
                UnityEngine.Application.lowMemory -= QPYX_ev_YXQP;
            }

            return(0);
        }
        catch (Exception e_YXQP)                {
            return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
        }
    }
Exemplo n.º 5
0
    public static Delegate UnityEngine_Application_LowMemoryCallback(LuaFunction func)
    {
        if (func == null)
        {
            UnityEngine.Application.LowMemoryCallback fn = delegate { };
            return(fn);
        }

        UnityEngine.Application.LowMemoryCallback d = (new UnityEngine_Application_LowMemoryCallback_Event(func)).Call;
        return(d);
    }
Exemplo n.º 6
0
    static int set_lowMemory(IntPtr L)
    {
        try
        {
            EventObject arg0 = null;

            if (LuaDLL.lua_isuserdata(L, 2) != 0)
            {
                arg0 = (EventObject)ToLua.ToObject(L, 2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "The event 'UnityEngine.Application.lowMemory' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.Application'"));
            }

            if (arg0.op == EventOp.Add)
            {
                UnityEngine.Application.LowMemoryCallback ev = (UnityEngine.Application.LowMemoryCallback) DelegateTraits <UnityEngine.Application.LowMemoryCallback> .Create(arg0.func);

                UnityEngine.Application.lowMemory += ev;
            }
            else if (arg0.op == EventOp.Sub)
            {
                UnityEngine.Application.LowMemoryCallback ev = (UnityEngine.Application.LowMemoryCallback)LuaMisc.GetEventHandler(null, typeof(UnityEngine.Application), "lowMemory");
                Delegate[] ds    = ev.GetInvocationList();
                LuaState   state = LuaState.Get(L);

                for (int i = 0; i < ds.Length; i++)
                {
                    ev = (UnityEngine.Application.LowMemoryCallback)ds[i];
                    LuaDelegate ld = ev.Target as LuaDelegate;

                    if (ld != null && ld.func == arg0.func)
                    {
                        UnityEngine.Application.lowMemory -= ev;
                        state.DelayDispose(ld.func);
                        break;
                    }
                }

                arg0.func.Dispose();
            }

            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 7
0
    public UnityEngine.Application.LowMemoryCallback UnityEngine_Application_LowMemoryCallback(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            UnityEngine.Application.LowMemoryCallback fn = delegate() { };
            return(fn);
        }

        if (!flag)
        {
            UnityEngine_Application_LowMemoryCallback_Event target = new UnityEngine_Application_LowMemoryCallback_Event(func);
            UnityEngine.Application.LowMemoryCallback       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            UnityEngine_Application_LowMemoryCallback_Event target = new UnityEngine_Application_LowMemoryCallback_Event(func, self);
            UnityEngine.Application.LowMemoryCallback       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
Exemplo n.º 8
0
 void Push_UnityEngine_Application_LowMemoryCallback(IntPtr L, UnityEngine.Application.LowMemoryCallback o)
 {
     ToLua.Push(L, o);
 }