Ejemplo n.º 1
0
    public Framework.OnUninitializeEventHandler Framework_OnUninitializeEventHandler(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            Framework.OnUninitializeEventHandler fn = delegate() { };
            return(fn);
        }

        if (!flag)
        {
            Framework_OnUninitializeEventHandler_Event target = new Framework_OnUninitializeEventHandler_Event(func);
            Framework.OnUninitializeEventHandler       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            Framework_OnUninitializeEventHandler_Event target = new Framework_OnUninitializeEventHandler_Event(func, self);
            Framework.OnUninitializeEventHandler       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
    static int set_OnUninitializeHandler(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.MonoSingletonBase.set_OnUninitializeHandler");
#endif
        try
        {
            Framework.MonoSingletonBase obj = (Framework.MonoSingletonBase)ToLua.CheckObject(L, 1, typeof(Framework.MonoSingletonBase));
            EventObject arg0 = null;

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

            if (arg0.op == EventOp.Add)
            {
                Framework.OnUninitializeEventHandler ev = (Framework.OnUninitializeEventHandler)arg0.func;
                obj.OnUninitializeHandler += ev;
            }
            else if (arg0.op == EventOp.Sub)
            {
                Framework.OnUninitializeEventHandler ev = (Framework.OnUninitializeEventHandler)arg0.func;
                obj.OnUninitializeHandler -= ev;
            }

            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 3
0
 void Push_Framework_OnUninitializeEventHandler(IntPtr L, Framework.OnUninitializeEventHandler o)
 {
     ToLua.Push(L, o);
 }