private ChallengeEntityInfo CreateChallengeEntityInfo(ArenaInfo arena) { ChallengeEntityInfo info = new ChallengeEntityInfo(); info.Guid = arena.GetId(); info.HeroId = arena.HeroId; info.Level = arena.Level; info.FightScore = arena.FightScore; info.NickName = arena.NickName; info.Rank = arena.GetRank(); info.UserDamage = 0; info.PartnerDamage.Clear(); for (int i = 0; i < arena.FightPartners.Count; i++) { PartnerInfo partner = arena.FightPartners[i]; DamageInfo damange_info = new DamageInfo(); damange_info.OwnerId = partner.Id; damange_info.Damage = 0; info.PartnerDamage.Add(damange_info); } return(info); }
internal static ArkCrossEngineMessage.ChallengeEntityData CreateChallengeEntityData(ChallengeEntityInfo entity) { ArkCrossEngineMessage.ChallengeEntityData target = new ArkCrossEngineMessage.ChallengeEntityData(); target.Guid = entity.Guid; target.Level = entity.Level; target.HeroId = entity.HeroId; target.NickName = entity.NickName; target.FightScore = entity.FightScore; target.Rank = entity.Rank; target.UserDamage = entity.UserDamage; target.PartnerDamage.Clear(); for (int i = 0; i < entity.PartnerDamage.Count; i++) { ArkCrossEngineMessage.DamageInfoData damange_info = new ArkCrossEngineMessage.DamageInfoData(); damange_info.OwnerId = entity.PartnerDamage[i].OwnerId; damange_info.Damage = entity.PartnerDamage[i].Damage; target.PartnerDamage.Add(damange_info); } return(target); }
public void ShowRecord(ChallengeInfo cInfo) { RoleInfo role = LobbyClient.Instance.CurrentRole; if (role == null) { return; } UIManager.Instance.ShowWindowByName("PPVPRecordData"); ChallengeEntityInfo myCInfo = cInfo.Target.Guid == role.Guid ? cInfo.Target : cInfo.Challenger; ChallengeEntityInfo theirCInfo = cInfo.Target.Guid == role.Guid ? cInfo.Challenger : cInfo.Target; bool isWin = cInfo.Target.Guid == role.Guid ? cInfo.IsChallengerSuccess ? false : true : cInfo.IsChallengerSuccess ? true : false; if (spHeadL != null) { spHeadL.spriteName = GetHeadSpName(myCInfo.HeroId); } if (spHeadR != null) { spHeadR.spriteName = GetHeadSpName(theirCInfo.HeroId); } if (lblNameL != null) { lblNameL.text = myCInfo.NickName; } if (lblNameR != null) { lblNameR.text = theirCInfo.NickName; } if (spWinOrLose != null) { spWinOrLose.spriteName = isWin ? "win" : "lose"; int num = spWinOrLose.transform.childCount; for (int i = 0; i < num; i++) { NGUITools.SetActive(spWinOrLose.transform.GetChild(i).gameObject, isWin); } } m_MaxDamage = GetMaxDamage(cInfo); for (int i = 0; i < leftItemList.Count; i++) { if (i == 0) {//主角 UpdateItem(leftItemList[i], myCInfo.HeroId, myCInfo.UserDamage, true); } else { if (myCInfo.PartnerDamage != null && myCInfo.PartnerDamage.Count >= i) { UpdateItem(leftItemList[i], myCInfo.PartnerDamage[i - 1].OwnerId, myCInfo.PartnerDamage[i - 1].Damage, false); NGUITools.SetActive(leftItemList[i], true); } else { NGUITools.SetActive(leftItemList[i], false); } } } for (int i = 0; i < rightItemList.Count; i++) { if (i == 0) {//主角 UpdateItem(rightItemList[i], theirCInfo.HeroId, theirCInfo.UserDamage, true); } else { if (theirCInfo.PartnerDamage != null && theirCInfo.PartnerDamage.Count >= i) { UpdateItem(rightItemList[i], theirCInfo.PartnerDamage[i - 1].OwnerId, theirCInfo.PartnerDamage[i - 1].Damage, false); NGUITools.SetActive(rightItemList[i], true); } else { NGUITools.SetActive(rightItemList[i], false); } } } }
private void InitVictoryPanel(ChallengeInfo cInfo) { RoleInfo role = LobbyClient.Instance.CurrentRole; if (role == null) { return; } UIManager.Instance.ShowWindowByName("PPVPVictoryPanel"); ChallengeEntityInfo myCInfo = cInfo.Target.Guid == role.Guid ? cInfo.Target : cInfo.Challenger; ChallengeEntityInfo theirCInfo = cInfo.Target.Guid == role.Guid ? cInfo.Challenger : cInfo.Target; bool isWin = cInfo.Target.Guid == role.Guid ? cInfo.IsChallengerSuccess ? false : true : cInfo.IsChallengerSuccess ? true : false; if (spHeadL != null) { spHeadL.spriteName = GetHeadSpName(myCInfo.HeroId); } if (spHeadR != null) { spHeadR.spriteName = GetHeadSpName(theirCInfo.HeroId); } if (lblNameL != null) { lblNameL.text = myCInfo.NickName; } if (lblNameR != null) { lblNameR.text = theirCInfo.NickName; } if (isWin) { if (win != null) { NGUITools.SetActive(win.gameObject, true); NGUITools.SetActive(lose.gameObject, false); } } else { if (lose != null) { NGUITools.SetActive(win.gameObject, false); NGUITools.SetActive(lose.gameObject, true); } } m_MaxDamage = GetMaxDamage(cInfo); for (int i = 0; i < leftItemList.Count; i++) { if (i == 0) {//主角 UpdateItem(leftItemList[i], myCInfo.HeroId, myCInfo.UserDamage, true); } else { if (myCInfo.PartnerDamage != null && myCInfo.PartnerDamage.Count >= i) { UpdateItem(leftItemList[i], myCInfo.PartnerDamage[i - 1].OwnerId, myCInfo.PartnerDamage[i - 1].Damage, false); NGUITools.SetActive(leftItemList[i], true); } else { NGUITools.SetActive(leftItemList[i], false); } } } for (int i = 0; i < rightItemList.Count; i++) { if (i == 0) {//主角 UpdateItem(rightItemList[i], theirCInfo.HeroId, theirCInfo.UserDamage, true); } else { if (theirCInfo.PartnerDamage != null && theirCInfo.PartnerDamage.Count >= i) { UpdateItem(rightItemList[i], theirCInfo.PartnerDamage[i - 1].OwnerId, theirCInfo.PartnerDamage[i - 1].Damage, false); NGUITools.SetActive(rightItemList[i], true); } else { NGUITools.SetActive(rightItemList[i], false); } } } }