Exemple #1
0
        private Sprite GetSpriteByIndex(FieldAndWeather weather)
        {
            var spName = string.Empty;

            switch (weather)
            {
            case FieldAndWeather.Sunny:
                spName = "sunny";
                break;

            case FieldAndWeather.Rainy:
                spName = "raining";
                break;

            case FieldAndWeather.Foggy:
                spName = "frog";
                break;

            case FieldAndWeather.Turf:
                spName = "grassland";
                break;

            case FieldAndWeather.Dirt:
                spName = "grassland_bm";
                break;

            case FieldAndWeather.Sand:
                spName = "sand";
                break;

            default:
                break;
            }
            return(GameObjectTool.LoadSprite(spName));
        }
Exemple #2
0
        //开始显示Logo
        public async ETTask ShowLogo()
        {
            if (battleModule.matchInfo.type > 1100 && battleModule.matchInfo.type <= 1199)
            {
                return;
            }

            uiData.go_LogoNode.SetActive(true);
            if (battleModule.matchInfo.type > 1100 && battleModule.matchInfo.type < 1199)
            {
                uiData.go_HQGJNode.SetActive(true);
                uiData.go_OtherNode.SetActive(false);
            }
            else
            {
                uiData.go_HQGJNode.SetActive(false);
                uiData.go_OtherNode.SetActive(true);
                uiData.image_LogoImg.sprite = GameObjectTool.LoadSprite("LOGO_" + battleModule.matchInfo.type);
                uiData.image_NameImg.sprite = GameObjectTool.LoadSprite("mz_" + battleModule.matchInfo.type);
            }

            await ModelComTools.TimerComponent.WaitAsync(2500);

            uiData.go_LogoNode.SetActive(false);
        }
Exemple #3
0
        private void SetSkillBuffInfo()
        {
            if (skillIndex >= skillIdList.Count)
            {
                return;
            }

            image_Fill.fillAmount        = 1;
            image_SkillIconZZ.fillAmount = 0;
            text_SkillCD.gameObject.SetActive(false);

            //设置技能图片
            var horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(skillIdList[skillIndex]);

            if (horseSkillDefine != null)                                                   //马匹技能
            {
                text_SkillName.text    = GameObjectTool.GetLanguage(horseSkillDefine.Name); //ModelComTools.Config.GetLanguageByID(horseSkillDefine.Name).Chinese;
                image_SkillIcon.sprite = GameObjectTool.LoadSprite(horseSkillDefine.Image);
            }
            else//骑手技能
            {
                text_SkillCD.gameObject.SetActive(false);
                var humanSkillDefine = ModelComTools.Config.GetHumanSkillByID(skillIdList[skillIndex]);
                if (humanSkillDefine != null)
                {
                    text_SkillName.text    = GameObjectTool.GetLanguage(humanSkillDefine.Name);//ModelComTools.Config.GetLanguageByID(humanSkillDefine.Name).Chinese;
                    image_SkillIcon.sprite = GameObjectTool.LoadSprite(humanSkillDefine.Image);
                }
            }
        }
Exemple #4
0
        public void SetSkillIdAndExistTime(int skillId, float existTime, string skillName)
        {
            this.skillId                 = skillId;
            this.existTime               = existTime;
            currTime                     = 0f;
            isInited                     = true;
            image_Fill.fillAmount        = 1;
            image_SkillIconZZ.fillAmount = 1;
            text_SkillCD.gameObject.SetActive(existTime != -1);
            transform.gameObject.SetActive(true);
            //设置技能图片
            var horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(this.skillId);

            if (horseSkillDefine != null)//马匹技能
            {
                image_SkillIcon.sprite = GameObjectTool.LoadSprite(horseSkillDefine.Image);
            }
            else//骑手技能
            {
                var humanSkillDefine = ModelComTools.Config.GetHumanSkillByID(this.skillId);
                if (humanSkillDefine != null)
                {
                    image_SkillIcon.sprite = GameObjectTool.LoadSprite(humanSkillDefine.Image);
                }
            }
        }
Exemple #5
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>";
            }
        }
Exemple #6
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);
        }
Exemple #7
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();
        }
Exemple #8
0
 public void SetDirInfo(string dir)
 {
     image_DirPic.sprite = GameObjectTool.LoadSprite(dir);
 }
Exemple #9
0
 public void SetStateInfo(string state)
 {
     image_DiPic.sprite = GameObjectTool.LoadSprite(state);
 }