示例#1
0
 private void UpdateUI()
 {
     if (SelfItemdata == null)
     {
         controller.Close();
         return;
     }
     AlliancesManager.Instance.Account.legionTechInfo.TechlevelDic.TryGetValue(SelfItemdata.skillid, out curSkillLevel);
     nextSkillLevel = curSkillLevel >= SelfItemdata.maxLevel ? -1 : curSkillLevel + 1;
     Legionlevel    = LegionModel.GetInstance().legionData.legionLevel;
     if (SelfItemdata.levelinfo.Count > curSkillLevel)
     {
         string skilldex;
         skilldex      = string.Format(SelfItemdata.skilldesTemplate, curSkillLevel, FloatToPercent(SelfItemdata.levelinfo[curSkillLevel].addition));
         curLevel.text = curlevelShadow.text = skilldex;
         if (nextSkillLevel != -1 && SelfItemdata.levelinfo.Count > nextSkillLevel)
         {
             skilldex    = string.Format(SelfItemdata.skilldesTemplate, nextSkillLevel, FloatToPercent(SelfItemdata.levelinfo[nextSkillLevel].addition));
             totalMedal  = BalanceResourceUtil.GetUserAllianceDonate();
             costMedal   = SelfItemdata.levelinfo[curSkillLevel].cost;
             colorstr    = costMedal > totalMedal ? "[ff6699]" : "[42fe79]";
             medalnumstr = string.Format("{0}{1}/{2}[-]", colorstr, totalMedal, costMedal);
             medalspobj.CustomSetActive(true);
             medalspobj.GetComponent <UIWidget>().ResetAnchors();
             medalNum.transform.localPosition = normallabelpos;
             LTUIUtil.SetGreyButtonEnable(breakBtn, true);
         }
         else if (nextSkillLevel == -1)
         {
             medalnumstr = EB.Localizer.GetString("ID_HAS_MAX_LEVEL");
             medalNum.transform.localPosition = maxlevellabelpos;
             medalspobj.CustomSetActive(false);
             LTUIUtil.SetGreyButtonEnable(breakBtn, false);
         }
         medalNum.text  = medalNumShadow.text = medalnumstr;
         nextLevel.text = nextLevelShadow.text = skilldex;
         if (!isFristEnter)
         {
             //if (!fx.IsPlaying())
             //{
             fx.Play(true);
             //}
         }
         isFristEnter = false;
     }
     isCouldClick = true;
 }