Example #1
0
    static int AddConnectedCallback(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        CC.Runtime.SocketManager     obj  = (CC.Runtime.SocketManager)LuaScriptMgr.GetUnityObjectSelf(L, 1, "CC.Runtime.SocketManager");
        Action <CC.Runtime.SocketId> arg0 = null;
        LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

        if (funcType2 != LuaTypes.LUA_TFUNCTION)
        {
            arg0 = (Action <CC.Runtime.SocketId>)LuaScriptMgr.GetNetObject(L, 2, typeof(Action <CC.Runtime.SocketId>));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 2);
            arg0 = (param0) =>
            {
                int top = func.BeginPCall();
                LuaScriptMgr.Push(L, param0);
                func.PCall(top, 1);
                func.EndPCall(top);
            };
        }

        obj.AddConnectedCallback(arg0);
        return(0);
    }