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