private void EGMI_ACK_PROPERTY_VECTOR2(int id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectPropertyVector2 xData = NFMsg.ObjectPropertyVector2.Parser.ParseFrom(xMsg.MsgData); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId)); if (go == null) { Debug.LogError("error id" + xData.PlayerId); return; } NFIPropertyManager propertyManager = go.GetPropertyManager(); for (int i = 0; i < xData.PropertyList.Count; i++) { string name = xData.PropertyList[i].PropertyName.ToStringUtf8(); NFMsg.Vector2 data = xData.PropertyList[i].Data; NFIProperty property = propertyManager.GetProperty(name); if (null == property) { NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR2); property = propertyManager.AddProperty(name, var); } property.SetVector2(mHelpModule.PBToNF(data)); } }
static public NFMsg.Vector2 NFToPB(NFVector2 value) { NFMsg.Vector2 vector = new NFMsg.Vector2(); vector.x = value.X(); vector.y = value.Y(); return(vector); }
static public NFMsg.Vector2 NFToPB(NFVector2 value) { NFMsg.Vector2 vector = new NFMsg.Vector2(); vector.x = value.X(); vector.y = value.Y(); return vector; }