| | |
| | | { |
| | | |
| | | public int heroStar |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return 0; |
| | | return itemHero.GetUseDataFirstValue(72); |
| | | } |
| | | } |
| | | |
| | | { |
| | | get |
| | | { |
| | | if (itemHero == null) |
| | | return 0; |
| | | return itemHero.GetUseDataFirstValue(72); |
| | | } |
| | | } |
| | | |
| | | // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引 |
| | | // 77 # 英雄天赋洗炼随机ID列表 |
| | | // 79 # 英雄觉醒时随机天赋选项ID列表 |
| | |
| | | talentAttrDic[config.AttrID] = config.AttrValue * talentLvList[i]; |
| | | } |
| | | else |
| | | { |
| | | { |
| | | talentAttrDic[config.AttrID] += config.AttrValue * talentLvList[i]; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public int GetTalentAttrPer(int attrType) |
| | | { |
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType)) |
| | | { |
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType]; |
| | | return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0; |
| | | } |
| | | return 0; |
| | | { |
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType)) |
| | | { |
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType]; |
| | | return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int GetMaxStarCount() |
| | | { |
| | | if (Quality < 4) |
| | | return HeroUIManager.normalGiftMaxCnt * HeroUIManager.Instance.maxGiftLevel; |
| | | return HeroUIManager.giftMaxCnt * HeroUIManager.Instance.maxGiftLevel; |
| | | } |
| | | |
| | | public int GetTotalStarCount() |
| | | { |
| | | //talentLvList里的元素全部相加 |
| | | return talentLvList.Sum(); |
| | | } |
| | | |
| | | public bool IsFullStar() |
| | | { |
| | | //检查talentLvList 所有元素都大于等于10 |
| | | return talentLvList.All(x => x >= HeroUIManager.Instance.maxGiftLevel); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | if (quality == 1) |
| | | { |
| | | //692088 |
| | | return new Color32(105, 32, 136, 128); |
| | | //1D0029 |
| | | return new Color32(29, 0, 41, 128); |
| | | } |
| | | else if (quality == 2) |
| | | { |
| | | //886220 |
| | | return new Color32(136, 98, 32, 128); |
| | | //372300 |
| | | return new Color32(55, 35, 0, 128); |
| | | } |
| | | else if (quality == 3) |
| | | { |
| | | //884a20 |
| | | return new Color32(136, 74, 32, 128); |
| | | //3A1800 |
| | | return new Color32(58, 24, 0, 128); |
| | | } |
| | | else if (quality == 4) |
| | | { |
| | | //882020 |
| | | return new Color32(136, 32, 32, 128); |
| | | //3A0000 |
| | | return new Color32(58, 0, 0, 128); |
| | | } |
| | | return new Color32(0, 0, 0, 128); |
| | | } |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class HeroGiftLineCell : CellView |
| | | { |
| | | [SerializeField] GiftBaseCell[] cardList; |
| | | |
| | | public void Display(int index, List<int> configList) |
| | | { |
| | | for (int i = 0; i < cardList.Length; i++) |
| | | { |
| | | if (index < configList.Count) |
| | | { |
| | | var giftID = configList[index]; |
| | | var giftLV = HeroUIManager.Instance.maxGiftLevel; |
| | | cardList[i].SetActive(true); |
| | | cardList[i].Init(giftID, giftLV, () => |
| | | { |
| | | var giftConfig = HeroTalentConfig.Get(giftID); |
| | | SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV), |
| | | Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue))); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | cardList[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fe49c2bc0fa1bbf4eb5389f355876ebb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将天赋总览界面 |
| | | /// </summary> |
| | | public class HeroGiftWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | |
| | | } |
| | | |
| | | List<int> configList = new List<int>(); |
| | | void CreateScroller() |
| | | { |
| | | configList = HeroTalentConfig.GetKeys().ToList(); |
| | | var totalCount = configList.Count; |
| | | |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < totalCount; i++) |
| | | { |
| | | if (i % 5 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as HeroGiftLineCell; |
| | | _cell.Display(cell.index, configList); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 01bd2b445a469e24281b88ed69b39166 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] GiftBaseCell[] giftBaseCells; |
| | | [SerializeField] Button totalGiftBtn; |
| | | [SerializeField] Button starUPBtn; |
| | | [SerializeField] Text starUPBtnText; |
| | | [SerializeField] Button washBtn; |
| | | |
| | | |
| | |
| | | }); |
| | | lvupBtn.AddListener(LVUp); |
| | | lvupBtn.onPress.AddListener(LVUp); |
| | | |
| | | totalGiftBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftWin>(); |
| | | }); |
| | | |
| | | starUPBtn.AddListener(StarUP); |
| | | } |
| | | |
| | | |
| | |
| | | addPerObject.SetActive(true); |
| | | for (int i = 0; i < addPerText.Length; i++) |
| | | { |
| | | addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer); |
| | | addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.LVAddPer); |
| | | } |
| | | addPerObject.Play(() => |
| | | { |
| | |
| | | |
| | | void RefreshGift() |
| | | { |
| | | RefreshGiftCell(); |
| | | |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | { |
| | | starUPBtn.interactable = false; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift7"); |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | } |
| | | |
| | | void RefreshGiftCell() |
| | | { |
| | | //传说以下只有4个 |
| | | int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt; |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | void StarUP() |
| | | { |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | { |
| | | return; |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public const int normalGiftMaxCnt = 4; //传说4以下 |
| | | public const int giftMaxCnt = 8; |
| | | public int maxGiftLevel; //天赋最高等级,其他功能可能会增加这个上限 |
| | | public int maxGiftLevel; //单天赋最高等级,其他功能可能会增加这个上限 |
| | | public int starLevelCanAwake; //x星可以觉醒 |
| | | |
| | | public int washItemID; |
| | |
| | | public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02 |
| | | public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 |
| | | public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 |
| | | public static readonly Color s_Gray = new Color32(104, 104, 104,255); //bbbbbb |
| | | public static readonly Color s_Gray = new Color32(187, 187, 187, 255); //bbbbbb |
| | | public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 |
| | | public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b |
| | | |