| | |
| | | [SerializeField] Text awakeLVText; |
| | | |
| | | //属性区 |
| | | [SerializeField] ScrollRect allAttrScroll; |
| | | [SerializeField] Button attrBtn; |
| | | [SerializeField] Image unfoldImg; //展开时按钮的图标 |
| | | [SerializeField] Image foldImg; //收起时按钮的图标 |
| | |
| | | [SerializeField] Text lvupBtnText; |
| | | [SerializeField] LongPressButton lvupBtn; //升级 突破 |
| | | [SerializeField] Button allAttrBtn; |
| | | [SerializeField] Text allPotentialText; //潜能 |
| | | |
| | | [SerializeField] GameObject potentialCell; //潜能和觉醒用于创建 |
| | | [SerializeField] Transform potentialCellParent; //潜能父节点 |
| | | List<GameObject> potentialCellList; //潜能 |
| | | [SerializeField] Transform awakeCellParent; //潜能父节点 |
| | | [SerializeField] GameObject awakeGo; |
| | | List<GameObject> awakeCellList; //觉醒 |
| | | |
| | | [SerializeField] GameObject fetterGo; |
| | | [SerializeField] Text[] fetterText; //羁绊 |
| | | [SerializeField] Text[] fetterNameText; //羁绊 |
| | | |
| | |
| | | |
| | | starBtn.AddListener(() => |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift14",hero.heroStar); |
| | | SmallTipWin.showText = Language.Get("HeroGift14", hero.heroStar); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | |
| | | potentialCellList = new List<GameObject>(); |
| | | awakeCellList = new List<GameObject>(); |
| | | } |
| | | |
| | | |
| | |
| | | hero = HeroManager.Instance.GetHero(guid); |
| | | unfoldState = false; |
| | | addPerObject.SetActive(false); |
| | | allAttrScroll.verticalNormalizedPosition = 1; |
| | | Display(); |
| | | } |
| | | |
| | |
| | | RefreshAllPotential(); |
| | | RefreshFetter(); |
| | | RefreshGift(); |
| | | RefreshAwake(); |
| | | } |
| | | |
| | | void RefreshItemLockEvent(PackType type, string guid, bool lockState) |
| | |
| | | var index = HeroUIManager.Instance.heroSortList.IndexOf(guid); |
| | | if (index == -1) |
| | | return; |
| | | allAttrScroll.verticalNormalizedPosition = 1; |
| | | int resultIndex = index + changeValue; |
| | | //循环处理 |
| | | if (resultIndex < 0) |
| | |
| | | if (!HeroUIManager.Instance.IsLVMax(hero)) |
| | | { |
| | | lvupBtnText.text = Language.Get("L1109"); |
| | | lvupBtn.interactable = true; |
| | | lvupBtn.SetColorful(null, true); |
| | | lvupMoneyIcon.SetActive(true); |
| | | |
| | | if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero)) |
| | |
| | | lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(lvupConfig.UPCostItem[0]).IconKey); |
| | | lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], lvupConfig.UPCostItem[1], TextColType.NavyBrown); |
| | | } |
| | | lvupBtn.SetInteractable(true); |
| | | |
| | | } |
| | | else |
| | | { |
| | | lvupBtnText.text = Language.Get("L1110"); |
| | | lvupBtn.interactable = false; |
| | | lvupBtn.SetColorful(null, false); |
| | | lvupBtn.SetInteractable(false); |
| | | lvupMoneyIcon.SetActive(false); |
| | | |
| | | } |
| | |
| | | Debug.LogError("未配置技能" + nextQualityBreakConfig.SkillID); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (i >= potentialCellList.Count) |
| | | { |
| | | potentialCellList.Add(Instantiate(potentialCell, potentialCellParent)); |
| | | } |
| | | var go = potentialCellList[i]; |
| | | var descText = go.GetComponent<Text>(); |
| | | var nameText = go.GetComponent<Text>("skillname"); |
| | | go.SetActive(true); |
| | | if (i < hero.breakLevel) |
| | | { |
| | | allAttrStr += Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr)) + "\n"; |
| | | nameText.text = Language.Get("herocard63", i + 1); |
| | | descText.text = string.Join(Language.Get("L1112"), attrStrArr); |
| | | } |
| | | else |
| | | { |
| | | //置灰 |
| | | allAttrStr += UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr))) + "\n"; |
| | | nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1)); |
| | | descText.text = UIHelper.AppendColor(TextColType.NavyGray, string.Join(Language.Get("L1112"), attrStrArr)); |
| | | } |
| | | } |
| | | |
| | | allPotentialText.text = allAttrStr.Trim(); |
| | | |
| | | } |
| | | |
| | | //羁绊 |
| | | void RefreshFetter() |
| | | { |
| | | if (hero.heroConfig.FetterIDList.Length == 0) |
| | | { |
| | | fetterGo.SetActive(false); |
| | | return; |
| | | } |
| | | fetterGo.SetActive(true); |
| | | |
| | | for (int i = 0; i < fetterText.Length; i++) |
| | | { |
| | | if (i < hero.heroConfig.FetterIDList.Length) |
| | |
| | | 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); |
| | | fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray); |
| | | fetterNameText[i].text = fetterConfig.FetterName; |
| | | fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray); |
| | | fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray); |
| | | |
| | | } |
| | | else |
| | |
| | | { |
| | | HeroUIManager.Instance.RefreshGiftCell(giftBaseCells, hero); |
| | | |
| | | if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality)) |
| | | if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality)) |
| | | { |
| | | starUPBtnText.text = Language.Get("HeroGift7"); |
| | | starUPBtn.SetInteractable(false); |
| | | starUPBtn.SetInteractable(false); |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | starUPBtn.SetInteractable(true); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | starUPBtn.SetInteractable(true); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | void StarUP() |
| | | { |
| | |
| | | UIManager.Instance.OpenWindow<HeroGiftWashWin>(); |
| | | |
| | | } |
| | | |
| | | |
| | | void RefreshAwake() |
| | | { |
| | | if (!HeroAwakeConfig.CanAwake(hero.heroId, 1)) |
| | | { |
| | | awakeGo.SetActive(false); |
| | | return; |
| | | } |
| | | awakeGo.SetActive(true); |
| | | |
| | | var maxLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId); |
| | | var starCnt = HeroQualityConfig.Get(hero.Quality).InitStarUpper; |
| | | for (int i = 1; i <= maxLV; i++) |
| | | { |
| | | if (i > awakeCellList.Count) |
| | | { |
| | | awakeCellList.Add(Instantiate(potentialCell, awakeCellParent)); |
| | | } |
| | | var go = awakeCellList[i - 1]; |
| | | var descText = go.GetComponent<Text>(); |
| | | var nameText = go.GetComponent<Text>("skillname"); |
| | | go.SetActive(true); |
| | | |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, i); |
| | | |
| | | int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3; |
| | | var awakeStr = string.Empty; |
| | | if (type == 1) |
| | | { |
| | | starCnt += config.AddStarUpper; |
| | | awakeStr = Language.Get("HeroAwake8", config.UnlockTalentSlot, starCnt); |
| | | } |
| | | else if (type == 2) |
| | | { |
| | | awakeStr = SkillConfig.Get(config.SkillID).Description; |
| | | } |
| | | else |
| | | { |
| | | for (int k = 0; k < config.AttrIDList.Length; k++) |
| | | { |
| | | awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k]) + |
| | | (k == config.AttrIDList.Length - 1 ? "" : "\n"); |
| | | } |
| | | } |
| | | |
| | | if (i - 1 < hero.awakeLevel) |
| | | { |
| | | nameText.text = Language.Get("herocard12", i) + Language.Get("L1096"); |
| | | descText.text = awakeStr; |
| | | } |
| | | else |
| | | { |
| | | //置灰 |
| | | nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096")); |
| | | descText.text = UIHelper.AppendColor(TextColType.NavyGray, awakeStr); |
| | | } |
| | | } |
| | | } |
| | | } |