Exemplo n.º 1
0
        private void SetAdmissItemUIInfo(int i, GameObject instanceAdmissionUI)
        {
            Text text_TextHorseNumber = instanceAdmissionUI.transform.Find("TextHorseNumber").GetComponent <Text>();
            Text text_TextHorseName   = instanceAdmissionUI.transform.Find("TextHorseName").GetComponent <Text>();
            Text text_TextHorsePower  = instanceAdmissionUI.transform.Find("TextHorsePower").GetComponent <Text>();

            text_TextHorseNumber.text = string.Format("{0}", (allHorseView[i].data.Id + 1) + "");
            text_TextHorseName.text   = allHorseView[i].data.horseName;
            Image image_ItemMatchBg = instanceAdmissionUI.transform.Find("SaiMaJianJieDiTu").GetComponent <Image>();

            //GameObjectTool.TextOverFlowLimitWidth(text_TextHorseName, allHorseView[i].data.horseName);
            //if (allHorseView[i].data.horseName.Contains("famousHorse__"))
            //{
            //    GameObjectTool.TextOverFlowLimitWidth(text_TextHorseName, allHorseView[i].data.horseName.Substring(13));
            //}
            text_TextHorsePower.text = allHorseView[i].data.fightValue + "";

            MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;

            if (matchModule.isSelfPlayer(allHorseView[i].data.playerUid))
            {
                image_ItemMatchBg.sprite = GameObjectTool.LoadSprite("templateBg1");
                //text_TextHorseNumber.text = $"<color=#ffb400>{text_TextHorseNumber.text}</color>";
                //text_TextHorseName.text= $"<color=#ffb400>{text_TextHorseName.text}</color>";
            }
        }
Exemplo n.º 2
0
        public void UpdateUIInfo(ETModel.Match.HorseRunData horsePar, float diWidthPar, float diHeightPar)
        {
            if (horsePar == null)
            {
                return;
            }

            horse    = horsePar;
            diWidth  = diWidthPar;
            diHeight = diHeightPar;

            bool isSelf = battleModule.isSelfPlayer(horse.playerUid);

            go_RankIconMy.SetActive(isSelf);
            image_RankIcon.sprite = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1));

            float yPos = -diHeight * (horse.PathId / 13f);

            recttrans.localPosition = new Vector3(0, yPos, 0);
        }
Exemplo n.º 3
0
        public void RefreshItem(ETModel.Match.HorseRunData horse)//排名变化时动态刷新Item显示
        {
            this.horse = horse;
            //-------------------------
            //bool isFamousHorse = horse.horseName.Contains("famousHorse__"); //是否是名马
            //string horseName = isFamousHorse? horse.horseName.Substring(13): horse.playerNickname;
            //Eris 2021_10_19_17:15
            string horseName = horse.horseName;

            bool isSelf = battleModule.isSelfPlayer(horse.playerUid);

            matchItemData.image_Normal_iteminfo_bg.gameObject.SetActive(!isSelf);
            matchItemData.image_famousBg.gameObject.SetActive(isSelf);
            //if (isSelf)
            //{
            //    matchItemData.text_TextMatchItemRank_4.text = $"<color=#a7ff34>{horse.Rank + 1}</color>";
            //    matchItemData.text_TextMatchItemPlayer_6.text = $"<color=#a7ff34>{horseName}</color>";
            //}
            //else
            //{
            //    matchItemData.text_TextMatchItemRank_4.text = $"<color=white>{horse.Rank + 1}</color>";
            //    matchItemData.text_TextMatchItemPlayer_6.text = $"<color=white>{horseName}</color>";
            //}
            matchItemData.text_TextMatchItemPlayer_6.text = GameObjectTool.ShortenDisplayText(horseName, 15);//horseName;
            matchItemData.text_TextMatchItemRank_4.text   = (horse.Rank + 1) + string.Empty;
            matchItemData.image_haoIcon.sprite            = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1));

            //if (horse.Rank < 3)
            //{
            //    matchItemData.image_RankPic.enabled = true;
            //    matchItemData.image_RankPic.sprite = GameObjectTool.LoadSprite("icon_Rank0" + horse.Rank);
            //    matchItemData.text_TextMatchItemRank_4.enabled = false;
            //}
            //else
            //{
            matchItemData.image_RankPic.enabled            = true;
            matchItemData.text_TextMatchItemRank_4.enabled = true;
            // }
            matchItemData.text_TextMatchItemPower_7.text = horse.fightValue + string.Empty;
            UpdateItemSelect();
        }