Ejemplo n.º 1
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);
            }
        }