| | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// </summary> |
| | | public partial class HeroTrainWin : UIBase |
| | | public class HeroTrainWin : UIBase |
| | | { |
| | | [SerializeField] Button showFuncBtn; //只显示立绘时点击,显示功能 |
| | | [SerializeField] Transform funcForm; |
| | |
| | | [SerializeField] Image countryImg; |
| | | [SerializeField] Text awakeLVText; |
| | | |
| | | //属性区 |
| | | [SerializeField] Button attrBtn; |
| | | [SerializeField] Image unfoldImg; //展开时按钮的图标 |
| | | [SerializeField] Image foldImg; //收起时按钮的图标 |
| | |
| | | [SerializeField] LongPressButton lvupBtn; |
| | | [SerializeField] Button allAttrBtn; |
| | | [SerializeField] Text allPotentialText; //潜能 |
| | | [SerializeField] Text[] fetterText; //羁绊 |
| | | [SerializeField] Text[] fetterNameText; //羁绊 |
| | | |
| | | |
| | | string guid; |
| | | HeroInfo hero; |
| | | |
| | |
| | | ChangeHero(-1); |
| | | }); |
| | | |
| | | lockBtn.AddListener(()=> { hero.ChangeLockState(); }); |
| | | lockBtn.AddListener(() => { hero.ChangeLockState(); }); |
| | | resetBtn.AddListener(ResetBtnClick); |
| | | deleteBtn.AddListener(DeleteHero); |
| | | awakeBtn.AddListener(() => |
| | |
| | | RefreshFoldState(); |
| | | RefreshAttr(); |
| | | RefreshAllPotential(); |
| | | RefreshFetter(); |
| | | } |
| | | |
| | | void RefreshItemLockEvent(PackType type, string guid, bool lockState) |
| | |
| | | { |
| | | |
| | | if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount) |
| | | { |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax"); |
| | | return; |
| | | } |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false)); |
| | | |
| | | |
| | | } |
| | | |
| | | void DeleteHero() |
| | |
| | | List<string> attrStrArr = new List<string>(); |
| | | for (int j = 0; j < nextQualityBreakConfig.AttrIDList.Length; j++) |
| | | { |
| | | if (nextQualityBreakConfig.AttrIDList[j] == 0) |
| | | continue; |
| | | string format = i < hero.breakLevel ? "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}") : "{0}+{1}"; |
| | | attrStrArr.Add(PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[j], nextQualityBreakConfig.AttrValueList[j], format)); |
| | | } |
| | | |
| | | if (nextQualityBreakConfig.SkillID != 0) |
| | | { |
| | | attrStrArr.Add(SkillConfig.Get(nextQualityBreakConfig.SkillID)?.Description); |
| | | var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID); |
| | | if (skill != null) |
| | | { |
| | | attrStrArr.Add(skill.Description); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("未配置技能" + nextQualityBreakConfig.SkillID); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (i < hero.breakLevel) |
| | | { |
| | | allAttrStr += Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr)) + "\n"; |
| | |
| | | |
| | | } |
| | | |
| | | //羁绊 |
| | | void RefreshFetter() |
| | | { |
| | | for (int i = 0; i < fetterText.Length; i++) |
| | | { |
| | | if (i < hero.heroConfig.FetterIDList.Length) |
| | | { |
| | | fetterText[i].SetActive(true); |
| | | var fetterID = hero.heroConfig.FetterIDList[i]; |
| | | HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID); |
| | | List<string> heroNames = new List<string>(); |
| | | bool isAllCollect = true; //是否全收集 |
| | | foreach (var tmpHeroID in fetterConfig.HeroIDList) |
| | | { |
| | | heroNames.Add(HeroConfig.Get(tmpHeroID).Name); |
| | | if (HeroManager.Instance.GetHeroCountByID(tmpHeroID) == 0) |
| | | { |
| | | isAllCollect = false; |
| | | } |
| | | } |
| | | var attrStr = string.Join(Language.Get("SplitString1"), heroNames) + Language.Get("herocard38"); |
| | | |
| | | for (int j = 0; j < fetterConfig.AttrIDList.Length; j++) |
| | | { |
| | | string format = !isAllCollect ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"); |
| | | attrStr += Language.Get("L1112") + PlayerPropertyConfig.GetFullDescription(fetterConfig.AttrIDList[j], fetterConfig.AttrValueList[j], format); |
| | | } |
| | | fetterText[i].text = attrStr; |
| | | fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray); |
| | | fetterNameText[i].text = fetterConfig.FetterName; |
| | | fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray); |
| | | |
| | | } |
| | | else |
| | | { |
| | | fetterText[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |