From 505eff9fbd3d2b90c675a9297e26209386ca29aa Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Thu, 03 Dec 2020 20:50:33 +0800 Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master --- Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs b/Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs index 3e0b78b..79119b2 100644 --- a/Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs +++ b/Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs @@ -4,14 +4,23 @@ using EnhancedUI.EnhancedScroller; using TMPro; using DG.Tweening; +using KTGMGemClient; + public class FinalPanelItem : EnhancedScrollerCellView { public Text playerNameTxt; + public Text playerWaveTxt; public TextMeshProUGUI playerScoreTxt; + public TextMeshProUGUI indexTxt; - public Image icon; + //public Image icon; public Image backGround; + public Sprite tmpBackGround;//自己的背景 + public Sprite otherBackGround;//其他人的背景 + public Color tmpColor;//自己的字体颜色 + public Color otherColor;//其他人的字体颜色 + Vector3 offect; private RectTransform rt; @@ -25,23 +34,41 @@ rt = transform.GetComponent<RectTransform>(); } - Vector3 offect; + public void SetData(FinalPanelItemData data) { - playerNameTxt.text = data.playerName; - playerScoreTxt.text = data.score.ToString(); - if (data.spriteIcon != null) + playerNameTxt.text = data.httpInfo.nickname; + playerScoreTxt.text = data.httpInfo.score.ToString(); + playerWaveTxt.text = data.httpInfo.waveInfo; + + if (data.index > 3)//前三名的手动隐藏了 { - if (!icon.gameObject.activeSelf) icon.gameObject.SetActive(true); - icon.sprite = data.spriteIcon; - indexTxt.text = ""; + indexTxt.text = data.index.ToString(); + } + + if (data.httpInfo.username.Equals(GameConfig.Imei)) + { + //是自己 + if (backGround.sprite != tmpBackGround) + backGround.sprite = tmpBackGround; + if (playerNameTxt.color != tmpColor) + { + playerNameTxt.color = tmpColor; + playerScoreTxt.color = tmpColor; + playerWaveTxt.color = tmpColor; + } } else { - icon.gameObject.SetActive(false); - indexTxt.text = data.index.ToString(); + if (backGround.sprite != otherBackGround) + backGround.sprite = otherBackGround; + if (playerNameTxt.color != otherColor) + { + playerNameTxt.color = otherColor; + playerScoreTxt.color = otherColor; + playerWaveTxt.color = otherColor; + } } - backGround.sprite = data.spriteBackGround; if (rt != null) { offect.x = rt.anchoredPosition3D.x; -- Gitblit v1.9.1