/// <summary> /// PB类型使用IoMessagePBTypeImpl反序列 /// </summary> /// <param name="buf"></param> protected void pbType(byte[] buf) { IoMessagePBTypeImpl ioMessage = ProtostuffUtils.ProtobufDeserialize <IoMessagePBTypeImpl>(buf); //添加队列 IoMessageHandler.getInstance().push(ioMessage); }
// Update is called once per frame void Update() { ClientTcpIoMessage ioMessage = IoMessageHandler.getInstance().Pop(); if (ioMessage != null) { Handler(ioMessage); } }