//显示卡牌信息 public void ShowCardInfo(GameObject btn) { long guid = long.Parse(btn.transform.parent.parent.name); PVPPlayerInfo playerInfo = Obj_MyselfPlayer.GetMe().GetPvPPlayerInfoByGuid(guid); if (playerInfo != null && playerInfo.nlGUID != Obj_MyselfPlayer.GetMe().accountID) { UserCardItem card = new UserCardItem(); card.cardID = playerInfo.nlGUID; card.templateID = playerInfo.nTempleID; card.level = playerInfo.nLev; card.skillLevel = playerInfo.skill_level; //主动技能等级 card.addQualityAtt = playerInfo.add_quality_att; //攻击强化次数 card.addQualityHp = playerInfo.add_quality_hp; //血量强化次数 card.skillStudyId = playerInfo.studySkillId; card.skillStudyLev = playerInfo.studySkillLev; BoxManager.showCardInfoMessage(card); } else { long nleader = Obj_MyselfPlayer.GetMe().GetTeamLeaderCardID(); UserCardItem card = Obj_MyselfPlayer.GetMe().GetUserCardByGUID(nleader); BoxManager.showCardInfoMessage(card); } }
private void OnMsgAthteclicList(byte[] buffer) { PAthleticsList ret = Net.Deserialize <PAthleticsList>(buffer); if (!Net.CheckErrorCode(ret.errorCode, eCommand.ATHTECLIC_LIST)) { return; } PVPManager.Instance.AttackCount = ret.freeTimes; // 剩余次数 PVPManager.Instance.AttackRemainTime.SetTimeMilliseconds(ret.nextAthlecticTime); // 攻击冷却时间 PVPManager.Instance.MyRank = ret.rank; // 我的排名 PVPManager.Instance.MyHighRank = ret.maxRank; // 我的最高排名 // 对手 PVPManager.Instance.PlayerList.Clear(); foreach (var item in ret.athletics) { PVPPlayerInfo info = new PVPPlayerInfo(); info.Deserialize(item); PVPManager.Instance.PlayerList.Add(info); } PVPManager.Instance.SortPlayer(); // 刷新ui UIManager.Instance.RefreshWindow <UIPVPView>(); }
public override void OnBindData(params object[] param) { _info = (PVPPlayerInfo)param[0]; if (_info != null) { UserManager.Instance.RequestPlayerInfo(_info.EntityID); } }
public void SetInfo(PVPPlayerInfo info) { _info = info; _imgIcon.sprite = ResourceManager.Instance.GetPlayerIcon(info.Icon); _txtName.text = info.Name; _txtLevel.text = "Lv" + info.Level; _txtRank.text = info.Rank.ToString(); _txtFightScore.text = info.FightScore.ToString(); }
private void OnMsgOtherPlayerInfo(byte[] buffer) { PPlayerInfo ret = Net.Deserialize <PPlayerInfo>(buffer); if (!Net.CheckErrorCode(ret.errorCode, eCommand.OTHER_PLAYER_INFO)) { return; } PVPPlayerInfo info = PVPManager.Instance.GetPlayer(ret.roleAttrs.userId); if (info != null) { info.Deserialize(ret); } UIManager.Instance.RefreshWindow <UIPVPPlayerInfoView>(); }
public bool InitWithPlayerInfo(PVPPlayerInfo playerInfo, UIEventListener.VoidDelegate ShowCardInfo, UIEventListener.VoidDelegate OnSelectPvPItem) { transform.localPosition = new Vector3(0, 0, -1); transform.localScale = new Vector3(1, 1, 1); gameObject.name = playerInfo.nlGUID.ToString(); //------------------------卡牌背景及外框-------------------------------- //2013-10-12 Jack Wen //templeID < 0 情况的容错处理,暂时显示默认头像,且错误头像点击不给予反映// Tab_Card tabPCard = TableManager.GetCardByID(playerInfo.nTempleID); if (tabPCard != null) { int icon_star = tabPCard.Star; cardIconBG.spriteName = UserCardItem.littleCardFrameName[icon_star]; cardIconBorder.spriteName = UserCardItem.littleCardBorderName[icon_star]; UIEventListener.Get(cardIconBtn).onClick = ShowCardInfo; } //-------------------------------------------------------------------- labelRankValuel.text = playerInfo.nRank.ToString(); labelScoreValue.text = GetOccupyScoreByRank(playerInfo.nRank).ToString(); long leadCardID = 0; UserCardItem leaderCard = null; if (playerInfo.nlGUID == Obj_MyselfPlayer.GetMe().accountID) { leadCardID = Obj_MyselfPlayer.GetMe().GetTeamLeaderCardID(); leaderCard = Obj_MyselfPlayer.GetMe().GetUserCardByGUID(leadCardID); } int apperanceID = 0; Tab_Card tabCard; if (playerInfo.nlGUID == Obj_MyselfPlayer.GetMe().accountID) { labelName.text = Obj_MyselfPlayer.GetMe().accountName; labelFightValue.text = Obj_MyselfPlayer.GetMe().GetFightValue().ToString(); labelLevelValue.text = leaderCard.level.ToString(); tabCard = TableManager.GetCardByID(leaderCard.templateID); if (tabCard != null) { apperanceID = tabCard.Appearance; } } else { labelName.text = playerInfo.strName; labelFightValue.text = playerInfo.nFight.ToString(); labelLevelValue.text = playerInfo.nLev.ToString(); tabCard = TableManager.GetCardByID(playerInfo.nTempleID); if (tabCard != null) { apperanceID = tabCard.Appearance; } } Tab_Appearance tabAppearance = TableManager.GetAppearanceByID(apperanceID); if (tabAppearance != null) { cardIconIcon.spriteName = tabAppearance.HeadIcon; } if (playerInfo.nRank >= Obj_MyselfPlayer.GetMe().nHeroRank) { fightBtn.SetActive(false); } else if (Obj_MyselfPlayer.GetMe().nHeroRank >= 16 && playerInfo.nRank <= 10) //大于等于16名的情况是前10不能挑战 { fightBtn.SetActive(false); } else if (Obj_MyselfPlayer.GetMe().nHeroRank < 16 && playerInfo.nRank < (Obj_MyselfPlayer.GetMe().nHeroRank - 5)) // { fightBtn.SetActive(false); } else { fightBtn.SetActive(true); } UIEventListener.Get(fightBtn).onClick = OnSelectPvPItem; if (tabPCard == null || tabCard == null || tabAppearance == null) { return(false); } return(true); }