//聲明 public delegate RequestParams Request (); public delegate void Response (byte[] bytes); //實例化 Request req = delegate() { WLUser user = new WLUser (); user.UserName = userName; user.UserPassword = userPassword; RequestParams reqParams = new RequestParams (); reqParams.ParamObject = user; reqParams.Cmd = 200; return reqParams; }; Response res = delegate(byte[] bytes) { ResultStruct result = MsgPackSerializer.Deserialize<ResultStruct> (bytes); Debug.Log ("delegate receivedCallback: ResultStruct:" + result.ToString ()); // afterFun (result); }; //調用 socket.AsySendMessage (req, res);