| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// 武将培养界面 |
| | | /// functionOrder 0 代表培养 1 代表突破 |
| | | /// 暂时不做一级界面区分,待时装界面分析处理,目前突破也在这个界面 |
| | | /// </summary> |
| | | public class HeroTrainWin : UIBase |
| | | { |
| | |
| | | [SerializeField] Text awakeLVText; |
| | | |
| | | //属性区 |
| | | [SerializeField] ScrollRect allAttrScroll; |
| | | [SerializeField] Button attrBtn; |
| | | [SerializeField] ScrollRect allAttrScroll; //培养属性 滚动区 |
| | | [SerializeField] Button attrBtn; //培养区的拖拉按钮 |
| | | [SerializeField] Image unfoldImg; //展开时按钮的图标 |
| | | [SerializeField] Image foldImg; //收起时按钮的图标 |
| | | bool unfoldState = false;//是否展开 |
| | |
| | | [SerializeField] Image redpointAwake; |
| | | [SerializeField] Image redpointGift; |
| | | [SerializeField] Image redpointLVUP; |
| | | |
| | | |
| | | |
| | | #region 突破 |
| | | // 区分突破和培养模块 |
| | | [SerializeField] HeroLVBreakCell heroLVBreakCell; //对应培养的 allAttrScroll 和 attrBtn |
| | | |
| | | [SerializeField] GroupButtonEx trainMainButton; //培养入口按钮 |
| | | [SerializeField] GroupButtonEx breakMainButton; //突破入口按钮 |
| | | //入口伪红点用图片代替 |
| | | [SerializeField] Image trainMainRedImg; |
| | | [SerializeField] Image breakMainRedImg; |
| | | #endregion |
| | | |
| | | |
| | | Queue<HeroTrainAddAttrCell> lvupAttrQueue = new Queue<HeroTrainAddAttrCell>(); |
| | |
| | | { |
| | | freezeTipGo.SetActive(!freezeTipGo.activeSelf); |
| | | }); |
| | | |
| | | trainMainButton.AddListener(() => |
| | | { |
| | | functionOrder = 0; |
| | | DisplayTrainOrBreak(hero); |
| | | }); |
| | | |
| | | breakMainButton.AddListener(() => |
| | | { |
| | | functionOrder = 1; |
| | | DisplayTrainOrBreak(hero); |
| | | unfoldState = false; |
| | | RefreshFoldState(); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | RefreshAwake(); |
| | | RefreshFreeze(); |
| | | RefreshRedImg(); |
| | | DisplayTrainOrBreak(hero); |
| | | |
| | | |
| | | HeroUIManager.Instance.RemoveNewHero(hero.heroId); |
| | | ForceRefreshLayout(); |
| | |
| | | redpointAwake.SetActive(false); |
| | | redpointGift.SetActive(false); |
| | | redpointLVUP.SetActive(false); |
| | | trainMainRedImg.SetActive(false); |
| | | breakMainRedImg.SetActive(false); |
| | | |
| | | |
| | | var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId); |
| | | var itemPack = PackManager.Instance.GetSinglePack(PackType.Item); |
| | |
| | | if (heroCnt > 1) |
| | | { |
| | | redpointGift.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | } |
| | | |
| | | // var maxBreakLV = HeroBreakConfig.GetMaxBreakLv(hero.heroId); |
| | | // if (hero.breakLevel < maxBreakLV) |
| | | // { |
| | | // if (HeroUIManager.Instance.IsCanBreak(hero)) |
| | | // { |
| | | // var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel); |
| | | // if (itemPack.GetCountById(breakConfig.UPCostItemList[0][0]) >= breakConfig.UPCostItemList[0][1]) |
| | | // { |
| | | // redpointLVUP.SetActive(true); |
| | | // return; |
| | | // } |
| | | // return; |
| | | // } |
| | | // } |
| | | |
| | | |
| | | if (!HeroUIManager.Instance.IsLVMax(hero)) |
| | | { |
| | |
| | | if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1]) |
| | | { |
| | | redpointLVUP.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | } |
| | | } |
| | | |
| | |
| | | if (itemPack.GetCountById(config.UPCostItem[0]) >= config.UPCostItem[1]) |
| | | { |
| | | redpointAwake.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (HeroUIManager.Instance.IsCanBreak(hero)) |
| | | { |
| | | redpointLVUP.SetActive(true); |
| | | breakMainRedImg.SetActive(true); |
| | | } |
| | | |
| | | } |
| | | |
| | | #region 突破功能 |
| | | |
| | | void DisplayTrainOrBreak(HeroInfo hero) |
| | | { |
| | | //heroLVBreakCell; //对应培养的 allAttrScroll 和 attrBtn |
| | | if (functionOrder == 0) |
| | | { |
| | | heroLVBreakCell.SetActive(false); |
| | | allAttrScroll.SetActive(true); |
| | | attrBtn.SetActive(true); |
| | | trainMainButton.SelectBtn(); |
| | | } |
| | | else |
| | | { |
| | | heroLVBreakCell.SetActive(true); |
| | | allAttrScroll.SetActive(false); |
| | | attrBtn.SetActive(false); |
| | | |
| | | heroLVBreakCell.Display(hero); |
| | | breakMainButton.SelectBtn(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |