//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { GodWeaponGemObjV1 pb = ProtoBuf.Serializer.Deserialize <GodWeaponGemObjV1>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(GodWeaponGemObjV1 v) { if (v == null) { return; } m_Id = v.Id; m_Pos = v.Pos; }
//转化成Protobuffer类型函数 public GodWeaponGemObjV1 ToPB() { GodWeaponGemObjV1 v = new GodWeaponGemObjV1(); v.Id = m_Id; v.Pos = m_Pos; return(v); }