/// <summary> /// 获取仙侣信息 /// </summary> protected void S2C_GetCoupleInfo(Pt pt) { isMarrige = false; pt_companion_d591 msg = pt as pt_companion_d591; if (msg != null) { if (msg.create_time > 0) { isMarrige = true; if (coupleData == null) { coupleData = new CoupleData(msg); } else { coupleData.UpdateData(msg); } } else { coupleData = null; } } if (OnCoupleDataUpdata != null) { OnCoupleDataUpdata(); } }
/// <summary> /// 仙侣数据构造 聊天界面需要 /// </summary> /// <param name="_data"></param> public FriendsInfo(CoupleData _data) { configId = _data.objId; isOnline = _data.onlineState != 1; prof = _data.career; name = _data.objName; lev = _data.objLev; }
/// <summary> /// 通知结婚成功 /// </summary> //protected void S2C_GetCouple(Pt pt) //{ // pt_marry_success_d688 msg = pt as pt_marry_success_d688; // if (msg != null) // { // GameCenter.swornMng.isOpenSworn = OpenType.COUPLE; // } //} /// <summary> /// 通知离婚成功 /// </summary> protected void S2C_GetCoupleBrokeUp(Pt pt) { pt_req_break_marry_d531 msg = pt as pt_req_break_marry_d531; if (msg != null) { //Debug.Log(" 通知离婚成功 "); coupleData = null; GameCenter.uIMng.SwitchToUI(GUIType.NONE); } }
protected void UnRegist() { MsgHander.UnRegist(0xD591, S2C_GetCoupleInfo); MsgHander.UnRegist(0xD534, S2C_GetTokenUpLev); MsgHander.UnRegist(0xD759, S2C_GetInitimacyUpdata); //MsgHander.UnRegist(0xD688, S2C_GetCouple); MsgHander.UnRegist(0xD531, S2C_GetCoupleBrokeUp); MsgHander.UnRegist(0xD797, S2C_ShowFlower); titleRef = null; nextTitleRef = null; coupleData = null; isMarrige = false; }
void Refresh() { coupleData = GameCenter.coupleMng.coupleData; if (coupleData == null || coupleData.tokenId == 0 || coupleData.marrageTime == 0) { if (notMerrage != null) { notMerrage.SetActive(true); } if (merrage != null) { merrage.SetActive(false); } return; } if (coupleData != null) { if (notMerrage != null) { notMerrage.SetActive(false); } if (merrage != null) { merrage.SetActive(true); } DateTime _time = GameHelper.ToChinaTime(new DateTime(1970, 1, 1)).AddSeconds(coupleData.marrageTime); if (timeLab != null) { timeLab.text = ConfigMng.Instance.GetUItext(24, new string[6] { _time.Year.ToString(), _time.Month.ToString(), _time.Day.ToString(), _time.Hour.ToString(), _time.Minute.ToString(), coupleData.objName }); } if (MainData != null && myIcon != null) { myIcon.MakePixelPerfect(); myIcon.spriteName = MainData.IconName; } if (objIcon != null) { objIcon.MakePixelPerfect(); objIcon.spriteName = coupleData.ObjIcon; } if (intimacyLab != null) { intimacyLab.text = coupleData.intimacy.ToString(); } if (tokenItem != null) { tokenItem.FillInfo(new EquipmentInfo(coupleData.tokenId, EquipmentBelongTo.PREVIEW)); } if (tokenExpSli != null) { tokenExpSli.value = (float)coupleData.tokenExp / coupleData.Exp; } if (expLab != null) { expLab.text = coupleData.tokenExp + "/" + coupleData.Exp; } if (time != null) { time.text = coupleData.time.ToString(); } if (coupleData.isHoldMerige) { if (merraigeEx != null) { merraigeEx.IsGray = UISpriteEx.ColorGray.Gray; } } else { if (merraigeEx != null) { merraigeEx.IsGray = UISpriteEx.ColorGray.normal; } } for (int i = 0; i < start.Length; i++) { if (i < coupleData.tokenLev) { start[i].gameObject.SetActive(true); } else { start[i].gameObject.SetActive(false); } } EquipmentRef eqt = ConfigMng.Instance.GetEquipmentRef(coupleData.tokenId); if (eqt != null) { if (tokenNameLab != null) { tokenNameLab.text = eqt.name; } } if (coupleData.tokenLev >= 10)//等级已满 { if (tokenExpSli != null) { tokenExpSli.value = 1; } if (expLab != null) { expLab.text = coupleData.Exp + "/" + coupleData.Exp; } if (desAfterMaxLev != null) { desAfterMaxLev.gameObject.SetActive(true); } if (things != null) { things.gameObject.SetActive(false); } } else { if (desAfterMaxLev != null) { desAfterMaxLev.gameObject.SetActive(false); } if (things != null) { things.gameObject.SetActive(true); } for (int i = 0, max = coupleData.NextItems.Count; i < max; i++) { if (coupleData.NextItems[i].eid == 5 || coupleData.NextItems[i].eid == 6)//消耗金币 { if (coinCount != null) { coinCount.text = coupleData.NextItems[i].count + "/" + GameCenter.mainPlayerMng.MainPlayerInfo.TotalCoinCount; } } else//消耗物品 { consume = ConfigMng.Instance.GetEquipmentRef(coupleData.NextItems[i].eid); needItem = coupleData.NextItems[i]; if (itemName != null) { itemName.text = GameHelper.GetStringWithBagNumber(coupleData.NextItems[i]); } } } } } }