| Main/System/HeroUI/HeroCardCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroLVBreakCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroLVBreakCell.cs.meta | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroLVBreakWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroTrainWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroUIManager.Reborn.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HeroUI/HeroUIManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Language/Language.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Main/System/HeroUI/HeroCardCell.cs
@@ -92,7 +92,7 @@ heroCardBtn.AddListener(() => { HeroUIManager.Instance.selectHeroGuid = guid; UIManager.Instance.OpenWindow<HeroTrainWin>(); UIManager.Instance.OpenWindow<HeroTrainWin>(funcState == 3 ? 1 : 0); }); } } Main/System/HeroUI/HeroLVBreakCell.cs
New file @@ -0,0 +1,164 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; /// <summary> /// 武将突破界面 /// </summary> public class HeroLVBreakCell : MonoBehaviour { [SerializeField] Text breakLVText; [SerializeField] Text nextBreakLVText; // [SerializeField] Text lvText; // [SerializeField] Text nextLVText; [SerializeField] Text[] attrPerTextArr; [SerializeField] Text[] nextAttrPerTextArr; [SerializeField] Text potentialText; [SerializeField] Image[] moneyIcons; [SerializeField] Text[] moneyTexts; [SerializeField] Transform[] moneyRects; [SerializeField] Button breakBtn; [SerializeField] Text needLVText; // [SerializeField] ScrollRect scrollRect; //满级 [SerializeField] Text[] fullAttrPerTextArr; [SerializeField] Text fullBreakLVText; [SerializeField] Transform fullRect; [SerializeField] Transform normalRect; string guid; HeroInfo hero; protected void Awake() { breakBtn.AddListener(BreakLV); } public void Display(HeroInfo _hero) { hero = _hero; guid = _hero.itemHero.guid; if (hero == null) { return; } if (hero.breakLevel >= HeroBreakConfig.GetMaxBreakLv(hero.heroId)) { fullRect.SetActive(true); normalRect.SetActive(false); RefreshFull(); } else { fullRect.SetActive(false); normalRect.SetActive(true); RefreshLV(); // scrollRect.verticalNormalizedPosition = 1; } } void RefreshFull() { fullBreakLVText.text = Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel); for (int i = 0; i < fullAttrPerTextArr.Length; i++) { fullAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer * hero.breakLevel); } } public void RefreshLV() { breakLVText.text = Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel); nextBreakLVText.text = Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel + 1); // lvText.text = hero.qualityBreakConfig.LVMax.ToString(); // var nextBreakLVConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel + 1); // nextLVText.text = nextBreakLVConfig.LVMax.ToString(); for (int i = 0; i < attrPerTextArr.Length; i++) { attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer * hero.breakLevel); } for (int i = 0; i < nextAttrPerTextArr.Length; i++) { nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer * (hero.breakLevel + 1)); } for (int i = 0; i < moneyIcons.Length; i++) { if (i < hero.qualityBreakConfig.UPCostItemList.Length) { moneyRects[i].SetActive(true); moneyIcons[i].SetOrgSprite(ItemConfig.Get(hero.qualityBreakConfig.UPCostItemList[i][0]).IconKey); moneyTexts[i].text = UIHelper.ShowUseItem(PackType.Item, hero.qualityBreakConfig.UPCostItemList[i][0], hero.qualityBreakConfig.UPCostItemList[i][1]); } else { moneyRects[i].SetActive(false); } } var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1); if (nextQualityBreakConfig == null) { potentialText.text = ""; return; } List<string> attrStrArr = new List<string>(); for (int i = 0; i < nextQualityBreakConfig.AttrIDList.Length; i++) { if (nextQualityBreakConfig.AttrIDList[i] == 0) { continue; } attrStrArr.Add((string.IsNullOrEmpty(nextQualityBreakConfig.SkillIName) ? string.Empty : Language.Get("L1039", nextQualityBreakConfig.SkillIName)) + PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[i], nextQualityBreakConfig.AttrValueList[i])); } if (nextQualityBreakConfig.SkillID != 0) { var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID); if (skill != null) { attrStrArr.Add(Language.Get("L1039", skill.SkillName) + skill.Description); } else { Debug.LogError("未配置技能" + nextQualityBreakConfig.SkillID); } } potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join("\n", attrStrArr)); string needLV = UIHelper.AppendColor(hero.heroLevel < hero.qualityBreakConfig.UPLVNeed ? TextColType.Red : TextColType.Green, $"{hero.heroLevel}/{hero.qualityBreakConfig.UPLVNeed}"); needLVText.text = Language.Get("herobreak3", needLV); } void BreakLV() { if (!HeroUIManager.Instance.IsCanBreak(hero, 2)) { return; } var pack = new CB232_tagCSHeroBreak(); pack.ItemIndex = (ushort)hero.itemHero.gridIndex; GameNetSystem.Instance.SendInfo(pack); HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculateFightPower(false)); //设置个等待回复的标识 显示成功界面 HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() { guid = guid, type = HeroFuncType.Break, time = Time.time }; } } Main/System/HeroUI/HeroLVBreakCell.cs.meta
Main/System/HeroUI/HeroLVBreakWin.cs
File was deleted Main/System/HeroUI/HeroTrainWin.cs
@@ -6,7 +6,9 @@ /// <summary> /// 武将培养界面 /// 武将培养界面 /// functionOrder 0 代表培养 1 代表突破 /// 暂时不做一级界面区分,待时装界面分析处理,目前突破也在这个界面 /// </summary> public class HeroTrainWin : UIBase { @@ -42,8 +44,8 @@ [SerializeField] Text awakeLVText; //属性区 [SerializeField] ScrollRect allAttrScroll; [SerializeField] Button attrBtn; [SerializeField] ScrollRect allAttrScroll; //培养属性 滚动区 [SerializeField] Button attrBtn; //培养区的拖拉按钮 [SerializeField] Image unfoldImg; //展开时按钮的图标 [SerializeField] Image foldImg; //收起时按钮的图标 bool unfoldState = false;//是否展开 @@ -93,6 +95,19 @@ [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>(); @@ -187,6 +202,20 @@ { freezeTipGo.SetActive(!freezeTipGo.activeSelf); }); trainMainButton.AddListener(() => { functionOrder = 0; DisplayTrainOrBreak(hero); }); breakMainButton.AddListener(() => { functionOrder = 1; DisplayTrainOrBreak(hero); unfoldState = false; RefreshFoldState(); }); } @@ -263,6 +292,8 @@ RefreshAwake(); RefreshFreeze(); RefreshRedImg(); DisplayTrainOrBreak(hero); HeroUIManager.Instance.RemoveNewHero(hero.heroId); ForceRefreshLayout(); @@ -805,6 +836,9 @@ 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); @@ -813,22 +847,10 @@ 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)) { @@ -836,6 +858,7 @@ if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1]) { redpointLVUP.SetActive(true); trainMainRedImg.SetActive(true); } } @@ -857,10 +880,41 @@ 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 } Main/System/HeroUI/HeroUIManager.Reborn.cs
@@ -55,15 +55,19 @@ for (int i = 0; i < lv; i++) { var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, i); var itemID = config.UPCostItemList[0][0]; var count = config.UPCostItemList[0][1]; if (!itemCounDic.ContainsKey(itemID)) for (int j = 0; j < config.UPCostItemList.Length; j++) { itemCounDic[itemID] = count; } else { itemCounDic[itemID] += count; var itemID = config.UPCostItemList[j][0]; var count = config.UPCostItemList[j][1]; if (!itemCounDic.ContainsKey(itemID)) { itemCounDic[itemID] = count; } else { itemCounDic[itemID] += count; } } } Main/System/HeroUI/HeroUIManager.cs
@@ -197,9 +197,34 @@ } //是否达到可突破的条件 public bool IsCanBreak(HeroInfo hero) public bool IsCanBreak(HeroInfo hero, int showTip = 0) { return hero.heroLevel >= GetNeedLVByBreakLV(hero.Quality, hero.breakLevel); if (hero.heroLevel < GetNeedLVByBreakLV(hero.Quality, hero.breakLevel)) { //等级未达标 if (showTip != 0) { SysNotifyMgr.Instance.ShowTip("HeroLVNotEnough"); } return false; } if (hero.breakLevel >= HeroBreakConfig.GetMaxBreakLv(hero.heroId)) { //突破等级已达最高级 return false; } //材料是否足够 var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel); for (int i = 0; i < breakConfig.UPCostItemList.Length; i++) { if (!ItemLogicUtility.CheckItemCount(PackType.Item, breakConfig.UPCostItemList[i][0], breakConfig.UPCostItemList[i][1], showTip)) { return false; } } return true; } public int GetAllHeroPer() @@ -463,7 +488,7 @@ { if (!hero.isAttrActive) return 0; var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId); if (!hero.IsInTeamByTeamType(TeamType.Story)) { @@ -499,18 +524,9 @@ return 2; } var maxBreakLV = HeroBreakConfig.GetMaxBreakLv(hero.heroId); if (hero.breakLevel < maxBreakLV) if (IsCanBreak(hero)) { if (IsCanBreak(hero)) { var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel); if (itemPack.GetCountById(breakConfig.UPCostItemList[0][0]) >= breakConfig.UPCostItemList[0][1]) { return 3; } return 0; } return 3; } if (!IsLVMax(hero)) @@ -523,6 +539,7 @@ } return 0; } #region 红点 Main/System/Language/Language.cs
@@ -124,6 +124,81 @@ } } // 基础泛型版本 public static string Get<T1>(string _id, T1 arg1) { var content = Get(_id); try { // 使用泛型可以避免装箱,编译器会为值类型生成特化版本 return string.Format(content, arg1); } catch (Exception ex) { Debug.LogFormat("语言内容格式错误,id: {0}", _id); return content; } } public static string Get<T1, T2>(string _id, T1 arg1, T2 arg2) { var content = Get(_id); try { return string.Format(content, arg1, arg2); } catch (Exception ex) { Debug.LogFormat("语言内容格式错误,id: {0}", _id); return content; } } // 继续扩展更多参数... public static string Get<T1, T2, T3>(string _id, T1 arg1, T2 arg2, T3 arg3) { var content = Get(_id); try { return string.Format(content, arg1, arg2, arg3); } catch (Exception ex) { Debug.LogFormat("语言内容格式错误,id: {0}", _id); return content; } } public static string Get<T1, T2, T3, T4>(string _id, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { var content = Get(_id); try { return string.Format(content, arg1, arg2, arg3, arg4); } catch (Exception ex) { Debug.LogFormat("语言内容格式错误,id: {0}", _id); return content; } } public static string Get<T1, T2, T3, T4, T5>(string _id, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { var content = Get(_id); try { return string.Format(content, arg1, arg2, arg3, arg4, arg5); } catch (Exception ex) { Debug.LogFormat("语言内容格式错误,id: {0}", _id); return content; } } public static string GetFromLocal(int _id) { var languageInfo = PriorLanguageConfig.Get(_id);