示例#1
0
        private void SetInfo()
        {
            var list = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetAllProficiencyDesc();

            for (int i = 0; i < LevelLabelList.Count; i++)
            {
                LevelLabelList[i].text = string.Format("{0} Lv.{1}", ((i < list.Count) ? list[i].name : string.Empty), partnerData.GetProficiencyLevelByType(list[i].id));
            }

            int curlevel = partnerData.GetProficiencyLevelByType(CurType);

            CurUpData  = Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel);
            NextUpData = Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel + 1);

            var desc     = Data.CharacterTemplateManager.Instance.GetProficiencyDescByType(CurType);
            int grade    = partnerData.HeroInfo.role_grade > desc.limit.Length ? desc.limit.Length + 1 : partnerData.HeroInfo.role_grade;
            int levelMax = desc.limit[grade - 1];

            int cost = 0;

            if (NextUpData != null && curlevel < levelMax)
            {
                if (NextUpData.chipCost.Length >= grade && NextUpData.chipCost[0] >= 0 && cost < CostIconList.Count)
                {
                    CostIconList[cost].spriteName = "Ty_Icon_Suipian";
                    CostLabelList[cost].text      = NextUpData.chipCost[grade - 1].ToString();
                    cost++;
                }
                if (NextUpData.potenCost > 0 && cost < CostIconList.Count)
                {
                    CostIconList[cost].spriteName = "Ty_Icon_Qianneng";
                    CostLabelList[cost].text      = NextUpData.potenCost.ToString();
                    cost++;
                }
                if (NextUpData.goldCost.Length >= grade && NextUpData.goldCost[0] >= 0 && cost < CostIconList.Count)
                {
                    CostIconList[cost].spriteName = "Ty_Icon_Gold";
                    CostLabelList[cost].text      = NextUpData.goldCost[grade - 1].ToString();
                    cost++;
                }
                CostObj.CustomSetActive(true);
                UpBtn.isEnabled = true;
                UpSprite.color  = new Color(1, 1, 1);
            }
            else
            {
                CostObj.CustomSetActive(false);
                UpBtn.isEnabled = false;
                UpSprite.color  = new Color(1, 0, 1);
            }
        }
示例#2
0
        private void SetInfo(bool showTween = false)
        {
            int curlevel = partnerData.GetProficiencyLevelByType(CurType);

            CurUpData  = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel);
            NextUpData = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel + 1);

            CurTipLabel.text  = string.Format("{0} Lv.{1}", EB.Localizer.GetString("ID_CURRENT_LEVEL"), curlevel);
            NextTipLabel.text = string.Format("{0} Lv.{1}", EB.Localizer.GetString("ID_NEXT_LEVEL"), curlevel + 1);

            for (int i = 0; i < FxList.Count; i++)
            {
                FxList[i].CustomSetActive(false);
            }
            if (CurUpData != null)
            {
                string str = string.Format("+{0}%", CurUpData.ATK * 100);
                if (showTween && !CurATKTipLabel.text.Equals(str))
                {
                    ShowUpFx(0);
                }
                CurATKTipLabel.text = str;

                str = string.Format("+{0}%", CurUpData.maxHP * 100);
                if (showTween && !CurHPTipLabel.text.Equals(str))
                {
                    ShowUpFx(1);
                }
                CurHPTipLabel.text = str;

                str = string.Format("+{0}%", CurUpData.DEF * 100);
                if (showTween && !CurDEFTipLabel.text.Equals(str))
                {
                    ShowUpFx(2);
                }
                CurDEFTipLabel.text = str;
            }
            else
            {
                CurATKTipLabel.text = "+0%";
                CurHPTipLabel.text  = "+0%";
                CurDEFTipLabel.text = "+0%";
            }

            if (NextUpData != null)
            {
                NextATKTipLabel.text = string.Format("+{0}%", NextUpData.ATK * 100);
                NextHPTipLabel.text  = string.Format("+{0}%", NextUpData.maxHP * 100);
                NextDEFTipLabel.text = string.Format("+{0}%", NextUpData.DEF * 100);

                string color      = LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal;
                int    resBalance = BalanceResourceUtil.GetUserPoten();
                if (resBalance < NextUpData.potenCost)
                {
                    color = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                }
                else
                {
                    color = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }

                MetCostLabel.text = string.Format("[{0}]{1}[-]/{2}", color, BalanceResourceUtil.GetUserPoten(), NextUpData.potenCost);

                color      = LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal;
                resBalance = BalanceResourceUtil.GetUserGold();
                int grade = partnerData.HeroInfo.role_grade;
                if (grade > NextUpData.goldCost.Length)
                {
                    grade = NextUpData.goldCost.Length;
                }
                if (resBalance < NextUpData.goldCost[grade - 1])
                {
                    color = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                }
                GoldCostLabel.text = string.Format("[{0}]{1}[-]", color, NextUpData.goldCost[grade - 1]);
                NextInfoObj.CustomSetActive(true);
                MaxLevelObj.CustomSetActive(false);
                CostObj.CustomSetActive(true);
            }
            else
            {
                NextInfoObj.CustomSetActive(false);
                MaxLevelObj.CustomSetActive(true);
                CostObj.CustomSetActive(false);
            }
        }