//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { MMOMapDataMDVector3V1 pb = ProtoBuf.Serializer.Deserialize <MMOMapDataMDVector3V1>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(MMOMapDataMDVector3V1 v) { if (v == null) { return; } m_X = v.X; m_Y = v.Y; m_Z = v.Z; }
//转化成Protobuffer类型函数 public MMOMapDataMDVector3V1 ToPB() { MMOMapDataMDVector3V1 v = new MMOMapDataMDVector3V1(); v.X = m_X; v.Y = m_Y; v.Z = m_Z; return(v); }