示例#1
0
 public void ShowUI(Hotfix_LT.Data.ProficiencyUpTemplate cur, Hotfix_LT.Data.ProficiencyUpTemplate next)
 {
     LevelLabel.text = "Lv.0";
     Hotfix_LT.Data.ProficiencyUpTemplate topData = null;
     if (cur != null)
     {
         var temp = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyDescByType(cur.type);
         if (temp != null)
         {
             MainSprite.spriteName = temp.icon;
             NameLabel.text        = temp.name;
             LevelLabel.text       = string.Format("Lv.{0}", cur.level);
         }
         topData = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetTheTopProficiencyType(cur.type);
     }
     else if (next != null)
     {
         var temp = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyDescByType(next.type);
         if (temp != null)
         {
             MainSprite.spriteName = temp.icon;
             NameLabel.text        = temp.name;
             LevelLabel.text       = "Lv.0";
         }
         topData = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetTheTopProficiencyType(next.type);
     }
     else
     {
         MainSprite.spriteName = NameLabel.text = LevelLabel.text = string.Empty;
     }
     CurIncomeLabel.text  = GetDesc(cur, topData);
     NextIncomeLabel.text = GetDesc(next, topData);
     OpenUI();
 }
示例#2
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);
            }
        }
示例#3
0
        public static string GetDesc(Hotfix_LT.Data.ProficiencyUpTemplate data, Hotfix_LT.Data.ProficiencyUpTemplate topData = null)
        {
            string temp = string.Empty;

            if (data != null)
            {
                if (data.ATK > 0 || topData != null && topData.ATK > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_ATK"), Mathf.RoundToInt(data.ATK * 100));
                }
                if (data.maxHP > 0 || topData != null && topData.maxHP > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_MaxHP"), Mathf.RoundToInt(data.maxHP * 100));
                }
                if (data.DEF > 0 || topData != null && topData.DEF > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_DEF"), Mathf.RoundToInt(data.DEF * 100));
                }
                if (data.CritV > 0 || topData != null && topData.CritV > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_CritV"), Mathf.RoundToInt(data.CritV * 100));
                }
                if (data.speed > 0 || topData != null && topData.speed > 0)
                {
                    temp += string.Format("  {0}+{1}", EB.Localizer.GetString("ID_ATTR_Speed"), Mathf.RoundToInt(data.speed));
                }
                if (data.CritP > 0 || topData != null && topData.CritP > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_CritP"), Mathf.RoundToInt(data.CritP * 100));
                }
                if (data.AntiCritP > 0 || topData != null && topData.AntiCritP > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_CRIresist"), Mathf.RoundToInt(data.AntiCritP * 100));
                }
                if (data.SpExtra > 0 || topData != null && topData.SpExtra > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_SpExtra"), Mathf.RoundToInt(data.SpExtra * 100));
                }
                if (data.SpRes > 0 || topData != null && topData.SpRes > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_SpRes"), Mathf.RoundToInt(data.SpRes * 100));
                }
                if (data.DmgMulti > 0 || topData != null && topData.DmgMulti > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_DMGincrease"), Mathf.RoundToInt(data.DmgMulti * 100));
                }
                if (data.DmgRes > 0 || topData != null && topData.DmgRes > 0)
                {
                    temp += string.Format("  {0}+{1}%", EB.Localizer.GetString("ID_ATTR_DMGreduction"), Mathf.RoundToInt(data.DmgRes * 100));
                }
            }
            else if (topData != null)
            {
                if (topData.ATK > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_ATK"));
                }
                if (topData.maxHP > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_MaxHP"));
                }
                if (topData.DEF > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_DEF"));
                }
                if (topData.CritV > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_CritV"));
                }
                if (topData.speed > 0)
                {
                    temp += string.Format("  {0}+0", EB.Localizer.GetString("ID_ATTR_Speed"));
                }
                if (topData.CritP > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_CritP"));
                }
                if (topData.AntiCritP > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_CRIresist"));
                }
                if (topData.SpExtra > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_SpExtra"));
                }
                if (topData.SpRes > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_SpRes"));
                }
                if (topData.DmgMulti > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_DMGincrease"));
                }
                if (topData.DmgRes > 0)
                {
                    temp += string.Format("  {0}+0%", EB.Localizer.GetString("ID_ATTR_DMGreduction"));
                }
            }
            temp = temp.Trim();
            if (string.IsNullOrEmpty(temp))
            {
                temp = EB.Localizer.GetString("ID_LEGION_MEDAL_NOT");
            }
            return(temp);
        }
示例#4
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);
            }
        }