Exemplo n.º 1
0
    static int RemoveEvent(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 3);
            string     arg0      = ToLua.CheckString(L, 1);
            UIEvent    arg1      = (UIEvent)ToLua.CheckObject(L, 2, typeof(UIEvent));
            UICallBack arg2      = null;
            LuaTypes   funcType3 = LuaDLL.lua_type(L, 3);

            if (funcType3 != LuaTypes.LUA_TFUNCTION)
            {
                arg2 = (UICallBack)ToLua.CheckObject(L, 3, typeof(UICallBack));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 3);
                arg2 = DelegateFactory.CreateDelegate(typeof(UICallBack), func) as UICallBack;
            }

            UISystemEvent.RemoveEvent(arg0, arg1, arg2);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }