From ff032a0d727eee13399e29391e1437bea912337c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 06 十二月 2025 16:42:46 +0800
Subject: [PATCH] 121 【武将】武将系统 - 生效武将版本,同步属性计算,更改新筛选模式
---
Main/System/HeroUI/HeroCardLineTipCell.cs.meta | 11
Main/System/HeroUI/HeroCardLineTipCell.cs | 28 +
Main/System/HeroUI/HeroCollectionLvUpWin.cs | 142 +++---
Main/System/HeroUI/HeroUIManager.OnTeam.cs | 67 +-
Main/System/HeroUI/HeroUIManager.Collect.cs | 158 ++++--
Main/System/HappyXB/HeroCallScoreRuleWin.cs | 19
Main/System/Hero/HeroInfo.Properties.cs | 28
Main/System/Main/HeroFightingCardCell.cs | 2
Main/System/Hero/HeroManager.cs | 92 +++
Main/System/HeroUI/HeroCardLineCell.cs | 39 +
Main/System/HeroUI/HeroDeleteWin.cs | 16
Main/System/HeroUI/HeroTrainWin.cs | 2
Main/Component/UI/Common/GroupButtonEx.cs | 16
Main/Config/Configs/HeroQualityConfig.cs | 13
Main/System/HeroUI/HeroCollectionCardCell.cs | 14
Main/System/Main/FightPowerManager.cs | 55 +-
Main/System/HeroUI/HeroGiftEatSuccessWin.cs | 2
Main/System/HeroUI/HeroUIManager.Reborn.cs | 6
Main/System/HeroUI/HeroCollectionWin.cs | 39
Main/System/Hero/HeroInfo.cs | 9
Main/Utility/UIHelper.cs | 25 +
Main/System/HeroUI/HeroPosWin.cs | 21
Main/System/Main/FightPowerFormula.cs | 23
Main/Component/UI/Common/GroupButtonExManager.cs | 37 +
Main/System/HeroUI/HeroListWin.cs | 118 +++-
Main/System/HeroUI/HeroSelectBehaviour.cs | 211 +++++++--
Main/System/HeroUI/HeroUIManager.cs | 107 ++++
27 files changed, 895 insertions(+), 405 deletions(-)
diff --git a/Main/Component/UI/Common/GroupButtonEx.cs b/Main/Component/UI/Common/GroupButtonEx.cs
index 2db7001..4585c02 100644
--- a/Main/Component/UI/Common/GroupButtonEx.cs
+++ b/Main/Component/UI/Common/GroupButtonEx.cs
@@ -71,6 +71,15 @@
set { this.m_Title = value; }
}
+ [SerializeField] TextEx m_TitleOutline;
+ public TextEx titleOutline
+ {
+ get { return this.m_TitleOutline; }
+ set { this.m_TitleOutline = value; }
+ }
+
+
+
[SerializeField] UIEffectPlayer m_SelectEffect; //閫変腑鐗规晥
public UIEffectPlayer selectEffect
{
@@ -146,6 +155,11 @@
m_Title.color = m_Manager.GetTextColorForState(m_State);
}
+ if (m_TitleOutline != null && m_Manager != null)
+ {
+ m_TitleOutline.color = m_Manager.GetOutlineColorForState(m_State);
+ }
+
if (m_SelectEffect != null)
{
if (m_State == TitleBtnState.Click)
@@ -159,4 +173,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Main/Component/UI/Common/GroupButtonExManager.cs b/Main/Component/UI/Common/GroupButtonExManager.cs
index 176a92b..508bebf 100644
--- a/Main/Component/UI/Common/GroupButtonExManager.cs
+++ b/Main/Component/UI/Common/GroupButtonExManager.cs
@@ -27,12 +27,37 @@
}
[SerializeField] Color m_NormalTextColor = UIHelper.GetUIColor(TextColType.titleUnSelectColor); // 鏈�変腑鐘舵�佹枃瀛楅鑹�
- public Color normalTextColor {
+ public Color normalTextColor
+ {
get { return m_NormalTextColor; }
- set {
+ set
+ {
m_NormalTextColor = value;
}
}
+
+ //澧炲姞鍖呰竟棰滆壊
+ [SerializeField] Color m_SelectOutlineColor = UIHelper.GetUIColor(TextColType.titleUnSelectColor);
+ public Color selectedOutlineColor
+ {
+ get { return m_SelectOutlineColor; }
+ set
+ {
+ m_SelectOutlineColor = value;
+ }
+ }
+
+ [SerializeField] Color m_NormalOutlineColor = UIHelper.GetUIColor(TextColType.titleUnSelectColor);
+ public Color normalOutlineColor
+ {
+ get { return m_NormalOutlineColor; }
+ set
+ {
+ m_NormalOutlineColor = value;
+ }
+ }
+
+
void OnEnable()
@@ -153,7 +178,7 @@
m_Buttons.Sort((a, b) => { return a.transform.GetSiblingIndex() - b.transform.GetSiblingIndex(); });
sortyet = true;
}
-
+
/// <summary>
/// 鑾峰彇鎸夐挳鐘舵�佸搴旂殑鏂囨湰棰滆壊
/// </summary>
@@ -163,4 +188,10 @@
{
return state == TitleBtnState.Click ? m_SelectedTextColor : m_NormalTextColor;
}
+
+
+ public Color GetOutlineColorForState(TitleBtnState state)
+ {
+ return state == TitleBtnState.Click ? m_SelectOutlineColor : m_NormalOutlineColor;
+ }
}
\ No newline at end of file
diff --git a/Main/Config/Configs/HeroQualityConfig.cs b/Main/Config/Configs/HeroQualityConfig.cs
index 41e7b5a..95be87d 100644
--- a/Main/Config/Configs/HeroQualityConfig.cs
+++ b/Main/Config/Configs/HeroQualityConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Thursday, August 28, 2025
+// [ Date ]: 2025骞�12鏈�5鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -23,9 +23,6 @@
public int BreakLVAddPer;
public int StarAddPer;
public int[] BookActAwardMoney;
- public int BookInitAddPer;
- public int BookStarAddPer;
- public int BookBreakLVAddPer;
public int[][] DismissReturnItems;
public override int LoadKey(string _key)
@@ -64,13 +61,7 @@
}
}
- int.TryParse(tables[7],out BookInitAddPer);
-
- int.TryParse(tables[8],out BookStarAddPer);
-
- int.TryParse(tables[9],out BookBreakLVAddPer);
-
- DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[10].Replace("(", "[").Replace(")", "]"));
+ DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[7].Replace("(", "[").Replace(")", "]"));
}
catch (Exception exception)
{
diff --git a/Main/System/HappyXB/HeroCallScoreRuleWin.cs b/Main/System/HappyXB/HeroCallScoreRuleWin.cs
index c89a8b5..0f8d567 100644
--- a/Main/System/HappyXB/HeroCallScoreRuleWin.cs
+++ b/Main/System/HappyXB/HeroCallScoreRuleWin.cs
@@ -10,13 +10,17 @@
{
[SerializeField] ScrollerController scrollerController;
- [SerializeField] HeroSelectBehaviour heroSelectBehaviour;
+ [SerializeField] Transform heroSelectBehaviour;
+ HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
+
+ protected override void InitComponent()
+ {
+ fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
+ }
protected override void OnPreOpen()
{
- HeroUIManager.Instance.selectHeroCallListJob = 0;
- HeroUIManager.Instance.selectHeroCallListCountry = 0;
HeroUIManager.Instance.SortHeroCallList();
scrollerController.OnRefreshCell += OnRefreshCell;
@@ -31,13 +35,14 @@
public override void Refresh()
{
- heroSelectBehaviour.Display(0, HeroUIManager.Instance.selectHeroListJob, HeroUIManager.Instance.selectHeroListCountry, SelectJobCountry);
+ fiterManager.Display(0, SelectJobCountry);
}
- void SelectJobCountry(int job, int country)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ void SelectJobCountry(List<int> selects)
{
- HeroUIManager.Instance.selectHeroCallListJob = job;
- HeroUIManager.Instance.selectHeroCallListCountry = country;
+ HeroUIManager.Instance.selectHeroCallList = selects;
+
HeroUIManager.Instance.SortHeroCallList();
scrollerController.m_Scorller.RefreshActiveCellViews();
}
diff --git a/Main/System/Hero/HeroInfo.Properties.cs b/Main/System/Hero/HeroInfo.Properties.cs
index 7014c79..17dd9f3 100644
--- a/Main/System/Hero/HeroInfo.Properties.cs
+++ b/Main/System/Hero/HeroInfo.Properties.cs
@@ -117,8 +117,8 @@
}
- //涓婇樀灞炴��:鏀婚槻琛�
- public int GetOnBattleAddPer()
+ //鏀婚槻琛�鍔犳垚
+ public int GetAddPer()
{
return qualityConfig.InitAddPer + qualityConfig.LVAddPer * (heroLevel - 1) + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar;
}
@@ -129,20 +129,20 @@
return qualityConfig.InitAddPer + qualityConfig.LVAddPer * (1 - 1) + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar;
}
- public int GetLineupLVAddPer()
- {
- return qualityConfig.LVAddPer * (heroLevel - 1);
- }
+ // public int GetLineupLVAddPer()
+ // {
+ // return qualityConfig.LVAddPer * (heroLevel - 1);
+ // }
- public int GetLineupBreakLVAddPer()
- {
- return qualityConfig.BreakLVAddPer * breakLevel;
- }
+ // public int GetLineupBreakLVAddPer()
+ // {
+ // return qualityConfig.BreakLVAddPer * breakLevel;
+ // }
- public int GetLineupStarAddPer()
- {
- return qualityConfig.StarAddPer * heroStar;
- }
+ // public int GetLineupStarAddPer()
+ // {
+ // return qualityConfig.StarAddPer * heroStar;
+ // }
//棰濆閰嶇疆鐨勭櫨鍒嗙櫨姣斿姞鎴� 涓夊洿瀵瑰簲鐨� 鐧惧垎姣斿姞鎴�
public int GetSelfAddPer(int attrType)
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index 0fedafc..0646590 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -43,6 +43,15 @@
}
}
+ //鐢熸晥鐨勬灏� 锛堝姝﹀皢鍙敓鏁堜竴涓級
+ public bool isAttrActive
+ {
+ get
+ {
+ return itemHero.GetUseDataFirstValue(80) == 1;
+ }
+ }
+
public bool isLock
{
diff --git a/Main/System/Hero/HeroManager.cs b/Main/System/Hero/HeroManager.cs
index 49ef7bd..63dd298 100644
--- a/Main/System/Hero/HeroManager.cs
+++ b/Main/System/Hero/HeroManager.cs
@@ -83,29 +83,57 @@
return heroInfoDict.Values.ToList();
}
- public List<string> GetHeroGuidList(int job = 0, int country = 0)
+ /// 鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ public List<string> GetHeroGuidList(List<int> selectList = null)
{
- if (job == 0 && country == 0)
+ if (selectList.IsNullOrEmpty())
return heroInfoDict.Keys.ToList();
+ int job = selectList[0];
+ int country = selectList[1];
+ int hurtType = selectList[2];
+ int fightAttrType = selectList[3];
+ int specialAttrType = selectList[4];
List<string> retGuidList = new List<string>();
foreach (string guid in heroInfoDict.Keys)
{
HeroInfo heroInfo = heroInfoDict[guid];
- //0浠h〃鍏ㄩ儴
- if (job == 0 || country == 0)
+
+ //0浠h〃鍏ㄩ儴, 鍚岀骇鍒槸鍙閫夛紝涓嶅悓绾у埆涓轰笖鐨勫叧绯�
+ bool isMatch = true;
+ if (job != 0)
{
- if (job != 0 && job == heroInfo.heroConfig.Class)
- retGuidList.Add(guid);
- if (country != 0 && country == heroInfo.heroConfig.Country)
- retGuidList.Add(guid);
+ isMatch = isMatch && (job & (1 << heroInfo.heroConfig.Class)) > 0;
}
- else
+ if (country != 0)
{
- if (job == heroInfo.heroConfig.Class && country == heroInfo.heroConfig.Country)
- retGuidList.Add(guid);
+ isMatch = isMatch && (country & (1 << heroInfo.heroConfig.Country)) > 0;
}
+ if (hurtType != 0)
+ {
+ isMatch = isMatch && (hurtType & (1 << heroInfo.heroConfig.HurtType)) > 0;
+ }
+ if (fightAttrType != 0)
+ {
+ isMatch = isMatch && (fightAttrType & (1 << heroInfo.heroConfig.Specialty)) > 0;
+ }
+ if (specialAttrType != 0)
+ {
+ bool isMatch2 = false;
+ for (int i = 0; i < heroInfo.heroConfig.Specialty2.Length; i++)
+ {
+ isMatch2 = (specialAttrType & (1 << heroInfo.heroConfig.Specialty2[i])) > 0;
+ if (isMatch2)
+ break;
+ }
+ isMatch = isMatch && isMatch2;
+ }
+ if (isMatch)
+ {
+ retGuidList.Add(guid);
+ }
+
}
return retGuidList;
}
@@ -152,4 +180,46 @@
{
return (int)PackManager.Instance.GetSinglePack(PackType.Hero).GetCountById(heroID);
}
+
+ //鑾峰緱鐢熸晥鐨勬灏嗘暟閲�
+ public int GetAttrActiveHeroCount()
+ {
+ int count = 0;
+ foreach (HeroInfo heroInfo in heroInfoDict.Values)
+ {
+ if (heroInfo.isAttrActive)
+ {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ //鑾峰緱鏈敓鏁堢殑姝﹀皢鏁伴噺
+ public int GetNotActiveHeroCount()
+ {
+ int count = 0;
+ foreach (HeroInfo heroInfo in heroInfoDict.Values)
+ {
+ if (!heroInfo.isAttrActive)
+ {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ //鑾峰緱鎸囧畾ID涓斿睘鎬х敓鏁堢殑姝﹀皢
+ public HeroInfo GetHeroByID(int heroID)
+ {
+ foreach (HeroInfo heroInfo in heroInfoDict.Values)
+ {
+ if (heroInfo.heroId == heroID && heroInfo.isAttrActive)
+ {
+ return heroInfo;
+ }
+ }
+ return null;
+ }
+
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroCardLineCell.cs b/Main/System/HeroUI/HeroCardLineCell.cs
index 449b020..110da08 100644
--- a/Main/System/HeroUI/HeroCardLineCell.cs
+++ b/Main/System/HeroUI/HeroCardLineCell.cs
@@ -4,18 +4,41 @@
{
[SerializeField] HeroCardCell[] cardList;
- public void Display(int index)
- {
- for (int i = 0; i < cardList.Length; i++)
+ //鐢熸晥鍜屾湭鐢熸晥鍏辩敤 heroSortList锛宎ctiveCount 鐢熸晥鏁伴噺, index澶т簬10000 鏈敓鏁�
+ public void Display(int index, int activeCount)
+ {
+ if (index < 10000)
{
- if (i + index < HeroUIManager.Instance.heroSortList.Count)
+ //鐢熸晥
+ for (int i = 0; i < cardList.Length; i++)
{
- cardList[i].SetActive(true);
- cardList[i].Display(index + i);
+ if (i + index < activeCount)
+ {
+ cardList[i].SetActive(true);
+ cardList[i].Display(index + i);
+ }
+ else
+ {
+ cardList[i].SetActive(false);
+ }
}
- else
+ }
+ else
+ {
+ //鏈敓鏁�
+ index = index - 10000;
+
+ for (int i = 0; i < cardList.Length; i++)
{
- cardList[i].SetActive(false);
+ if (i + index < HeroUIManager.Instance.heroSortList.Count)
+ {
+ cardList[i].SetActive(true);
+ cardList[i].Display(index + i);
+ }
+ else
+ {
+ cardList[i].SetActive(false);
+ }
}
}
}
diff --git a/Main/System/HeroUI/HeroCardLineTipCell.cs b/Main/System/HeroUI/HeroCardLineTipCell.cs
new file mode 100644
index 0000000..b074bcf
--- /dev/null
+++ b/Main/System/HeroUI/HeroCardLineTipCell.cs
@@ -0,0 +1,28 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+public class HeroCardLineTipCell : CellView
+{
+ [SerializeField] Text tipText;
+ [SerializeField] Image tipBG;
+
+ //0 鐢熸晥 1 鏈敓鏁�
+ public void Display(int type)
+ {
+ if (type == 0)
+ {
+ tipText.text = Language.Get("herocard71", HeroManager.Instance.GetAttrActiveHeroCount());
+ //7E4038
+ tipText.color = new Color32(126, 64, 56, 255);
+ tipBG.SetOrgSprite("herolineactive", "Hero");
+ }
+ else
+ {
+ tipText.text = Language.Get("herocard72", HeroManager.Instance.GetNotActiveHeroCount());
+ //6E5C60
+ tipText.color = new Color32(110, 92, 96, 255);
+ tipBG.SetOrgSprite("herolinenoactive", "Hero");
+ }
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroCardLineTipCell.cs.meta b/Main/System/HeroUI/HeroCardLineTipCell.cs.meta
new file mode 100644
index 0000000..200f975
--- /dev/null
+++ b/Main/System/HeroUI/HeroCardLineTipCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 46a29d9aa6a41654ea999ddbb4131b97
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroCollectionCardCell.cs b/Main/System/HeroUI/HeroCollectionCardCell.cs
index 6ca449a..28de4b4 100644
--- a/Main/System/HeroUI/HeroCollectionCardCell.cs
+++ b/Main/System/HeroUI/HeroCollectionCardCell.cs
@@ -13,7 +13,7 @@
[SerializeField] Text nameText;
[SerializeField] Image trainStateImg;
[SerializeField] RedpointBehaviour redpoint;
- [SerializeField] Button bookLVBtn;
+ // [SerializeField] Button bookLVBtn;
[SerializeField] GameObject unGetObj;
[SerializeField] GameObject activeObj; // 鍙縺娲诲甫娴佸厜鏁堟灉鏉愯川
@@ -32,7 +32,7 @@
int funcState = HeroUIManager.Instance.GetHeroBookState(heroID, quality);
activeObj.SetActive(funcState == 1);
- bookLVBtn.SetActive(funcState > 1);
+ // bookLVBtn.SetActive(funcState > 1);
unGetObj.SetActive(funcState == 0);
countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
@@ -86,11 +86,11 @@
}
});
- bookLVBtn.AddListener(() =>
- {
- HeroUIManager.Instance.selectCollectHeroID = heroID;
- UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
- });
+ // bookLVBtn.AddListener(() =>
+ // {
+ // HeroUIManager.Instance.selectCollectHeroID = heroID;
+ // UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
+ // });
}
}
diff --git a/Main/System/HeroUI/HeroCollectionLvUpWin.cs b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
index 490e8d8..b4aa863 100644
--- a/Main/System/HeroUI/HeroCollectionLvUpWin.cs
+++ b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
@@ -18,9 +18,9 @@
[SerializeField] HeroHeadBaseCell afterHeadCell;
[SerializeField] Text name2;
- [SerializeField] Text[] attrNames;
- [SerializeField] Text[] beforeAttrValues;
- [SerializeField] Text[] afterAttrValues;
+ // [SerializeField] Text[] attrNames;
+ // [SerializeField] Text[] beforeAttrValues;
+ // [SerializeField] Text[] afterAttrValues;
[SerializeField] RichText awardInfo;
[SerializeField] Button btn;
@@ -59,39 +59,39 @@
HB122_tagSCHeroInfo.tagSCHero colData;
HeroUIManager.Instance.TryGetHeroBookInfo(HeroUIManager.Instance.selectCollectHeroID, out colData);
- var bookPer = HeroUIManager.Instance.GetHeroBookPer(HeroUIManager.Instance.selectCollectHeroID);
- if (state == 5 || state == 2)
- {
- //宸叉弧绾�
- titleText.text = state == 5 ? Language.Get("HeroAwake13") : Language.Get("HeroAwake12");
- fullPanel.SetActive(true);
- lvupPanel.SetActive(false);
+ // var bookPer = HeroUIManager.Instance.GetHeroBookPer(HeroUIManager.Instance.selectCollectHeroID);
+ // if (state == 5 || state == 2)
+ // {
+ // //宸叉弧绾�
+ // titleText.text = state == 5 ? Language.Get("HeroAwake13") : Language.Get("HeroAwake12");
+ // fullPanel.SetActive(true);
+ // lvupPanel.SetActive(false);
- fullHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
- name3.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
+ // fullHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
+ // name3.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
- for (int i = 0; i < fullAttrs.Length; i++)
- {
- fullAttrs[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
- bookPer, "{0} " + UIHelper.AppendColor(TextColType.Green, "+{1}"));
- }
- var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
- if (nextHeroID != 0)
- {
- fullImg.SetActive(false);
- btn.SetActive(true);
- //涓嬩竴涓�
- btnText.text = Language.Get("HeroAwake14");
- }
- else
- {
- fullImg.SetActive(state == 5);
- btn.SetActive(state == 2);
- btnText.text = Language.Get("L1109");
- }
+ // for (int i = 0; i < fullAttrs.Length; i++)
+ // {
+ // fullAttrs[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
+ // bookPer, "{0} " + UIHelper.AppendColor(TextColType.Green, "+{1}"));
+ // }
+ // var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
+ // if (nextHeroID != 0)
+ // {
+ // fullImg.SetActive(false);
+ // btn.SetActive(true);
+ // //涓嬩竴涓�
+ // btnText.text = Language.Get("HeroAwake14");
+ // }
+ // else
+ // {
+ // fullImg.SetActive(state == 5);
+ // btn.SetActive(state == 2);
+ // btnText.text = Language.Get("L1109");
+ // }
- }
- else
+ // }
+ // else
{
fullPanel.SetActive(false);
lvupPanel.SetActive(true);
@@ -100,7 +100,7 @@
beforeHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
name1.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
- int addPer = 0;
+ // int addPer = 0;
var qualityConfig = HeroQualityConfig.Get(config.Quality);
awardInfo.text = string.Empty;
unActiveGo.SetActive(false);
@@ -110,27 +110,27 @@
if (state == 1)
{
//婵�娲�
- addPer = qualityConfig.BookInitAddPer;
+ // addPer = qualityConfig.BookInitAddPer;
btnText.text = Language.Get("L1131"); //L1131 婵�娲�
awardInfo.text = Language.Get("HeroAwake10", UIHelper.GetIconNameWithMoneyType(qualityConfig.BookActAwardMoney[0]),
qualityConfig.BookActAwardMoney[1]);
unActiveGo.SetActive(true);
titleText.text = Language.Get("HeroAwake11");
}
- else if (state == 3)
- {
- //绐佺牬
- addPer = qualityConfig.BookBreakLVAddPer;
- btnText.text = Language.Get("L1109"); //鍗囩骇
- afterBreakLV++;
- }
- else if (state == 4)
- {
- //鍗囨槦
- addPer = qualityConfig.BookStarAddPer;
- btnText.text = Language.Get("L1109");
- afterStarLV++;
- }
+ // else if (state == 3)
+ // {
+ // //绐佺牬
+ // addPer = qualityConfig.BookBreakLVAddPer;
+ // btnText.text = Language.Get("L1109"); //鍗囩骇
+ // afterBreakLV++;
+ // }
+ // else if (state == 4)
+ // {
+ // //鍗囨槦
+ // addPer = qualityConfig.BookStarAddPer;
+ // btnText.text = Language.Get("L1109");
+ // afterStarLV++;
+ // }
else
{
var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
@@ -141,20 +141,27 @@
}
else
{
- btnText.text = Language.Get("L1109");
+ btnText.text = Language.Get("L1001");
}
+
+ fullPanel.SetActive(true);
+ lvupPanel.SetActive(false);
+
+ fullHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
+ name3.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
+
}
afterHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], afterStarLV);
name2.text = afterBreakLV == 0 ? config.Name :Language.Get("herocardbreaklv", config.Name, afterBreakLV);
- for (int i = 0; i < beforeAttrValues.Length; i++)
- {
- beforeAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer);
- attrNames[i].text = PlayerPropertyConfig.Get(PlayerPropertyConfig.basePerAttrs[i]).Name;
- afterAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer + addPer);
- }
+ // for (int i = 0; i < beforeAttrValues.Length; i++)
+ // {
+ // beforeAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer);
+ // attrNames[i].text = PlayerPropertyConfig.Get(PlayerPropertyConfig.basePerAttrs[i]).Name;
+ // afterAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer + addPer);
+ // }
}
}
@@ -167,16 +174,16 @@
//婵�娲�
SendPack(0);
}
- else if (state == 3)
- {
- //绐佺牬
- SendPack(2);
- }
- else if (state == 4)
- {
- //鍗囨槦
- SendPack(1);
- }
+ // else if (state == 3)
+ // {
+ // //绐佺牬
+ // SendPack(2);
+ // }
+ // else if (state == 4)
+ // {
+ // //鍗囨槦
+ // SendPack(1);
+ // }
else
{
var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
@@ -188,7 +195,8 @@
}
else
{
- SysNotifyMgr.Instance.ShowTip("HeroGift8");
+ // SysNotifyMgr.Instance.ShowTip("HeroGift8");
+ CloseWindow();
}
}
}
diff --git a/Main/System/HeroUI/HeroCollectionWin.cs b/Main/System/HeroUI/HeroCollectionWin.cs
index b72cd66..16a2331 100644
--- a/Main/System/HeroUI/HeroCollectionWin.cs
+++ b/Main/System/HeroUI/HeroCollectionWin.cs
@@ -13,9 +13,10 @@
[SerializeField] Button heroPackBtn;
[SerializeField] Text heroPackText;
[SerializeField] ScrollerController heroListScroller;
- [SerializeField] List<Text> totalAttrList;
+ // [SerializeField] List<Text> totalAttrList;
[SerializeField] Button attrBtn;
- [SerializeField] HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
+ [SerializeField] Transform heroSelectBehaviour;
+ HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
SinglePack singlePack;
@@ -32,6 +33,8 @@
{
HeroUIManager.Instance.QueryUnLockHeroPack();
});
+
+ fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
}
protected override void OnPreOpen()
@@ -41,8 +44,6 @@
PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
HeroUIManager.Instance.OnHeroCollectEvent += OnHeroCollectEvent;
heroListScroller.OnRefreshCell += OnRefreshCell;
- HeroUIManager.Instance.selectHeroCollectListJob = 0;
- HeroUIManager.Instance.selectHeroCollectListCountry = 0;
HeroUIManager.Instance.SortHeroCollectList();
Display();
}
@@ -59,10 +60,10 @@
void Display()
{
- fiterManager.Display(0, HeroUIManager.Instance.selectHeroCollectListJob, HeroUIManager.Instance.selectHeroCollectListCountry, SelectJobCountry);
+ fiterManager.Display(0, SelectJobCountry);
- CreateScroller();
- RefreshTotalAttr();
+ // CreateScroller();
+ // RefreshTotalAttr();
RefreshPackCount();
}
@@ -94,20 +95,20 @@
}
- void RefreshTotalAttr()
- {
- for (int i = 0; i < totalAttrList.Count; i++)
- {
- totalAttrList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
- HeroUIManager.Instance.allHeroBookPer);
- }
- }
+ // void RefreshTotalAttr()
+ // {
+ // for (int i = 0; i < totalAttrList.Count; i++)
+ // {
+ // totalAttrList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
+ // HeroUIManager.Instance.allHeroBookPer);
+ // }
+ // }
- void SelectJobCountry(int job, int country)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ void SelectJobCountry(List<int> selects)
{
- HeroUIManager.Instance.selectHeroCollectListJob = job;
- HeroUIManager.Instance.selectHeroCollectListCountry = country;
+ HeroUIManager.Instance.selectHeroCollectList = selects;
HeroUIManager.Instance.SortHeroCollectList();
CreateScroller();
}
@@ -173,7 +174,7 @@
void OnHeroCollectEvent()
{
- RefreshTotalAttr();
+ // RefreshTotalAttr();
heroListScroller.m_Scorller.RefreshActiveCellViews();
}
diff --git a/Main/System/HeroUI/HeroDeleteWin.cs b/Main/System/HeroUI/HeroDeleteWin.cs
index 0fd6a4f..bb811f3 100644
--- a/Main/System/HeroUI/HeroDeleteWin.cs
+++ b/Main/System/HeroUI/HeroDeleteWin.cs
@@ -12,7 +12,8 @@
{
[SerializeField] Button storeBtn;
[SerializeField] ScrollerController scroller;
- [SerializeField] HeroSelectBehaviour heroSelectBehaviour;
+ [SerializeField] Transform heroSelectBehaviour;
+ HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
[SerializeField] GameObject noHeroObj;
[SerializeField] Button quickSelectBtn;
[SerializeField] Button deleteBtn;
@@ -26,6 +27,7 @@
});
quickSelectBtn.AddListener(QuickSelect);
deleteBtn.AddListener(DeleteHero);
+ fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
}
protected override void OnPreOpen()
@@ -35,17 +37,15 @@
PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
- HeroUIManager.Instance.selectHeroDeleteListJob = 0;
- HeroUIManager.Instance.selectHeroDeleteListCountry = 0;
HeroUIManager.Instance.SortHeroDeleteList();
- heroSelectBehaviour.Display(0, HeroUIManager.Instance.selectHeroDeleteListJob, HeroUIManager.Instance.selectHeroDeleteListCountry, SelectJobCountry);
+ fiterManager.Display(0, SelectJobCountry);
RefreshEmptyTip();
//澶栭儴閫変腑
HeroUIManager.Instance.SelectDeleteHero(HeroManager.Instance.GetHero(HeroUIManager.Instance.jumpDeleteHeroGuid));
- CreateScroller();
+ // CreateScroller();
}
protected override void OnPreClose()
@@ -78,10 +78,10 @@
_cell.Display(cell.index);
}
- void SelectJobCountry(int job, int country)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ void SelectJobCountry(List<int> selects)
{
- HeroUIManager.Instance.selectHeroDeleteListJob = job;
- HeroUIManager.Instance.selectHeroDeleteListCountry = country;
+ HeroUIManager.Instance.selectHeroDeleteList = selects;
HeroUIManager.Instance.SortHeroDeleteList();
CreateScroller();
RefreshEmptyTip();
diff --git a/Main/System/HeroUI/HeroGiftEatSuccessWin.cs b/Main/System/HeroUI/HeroGiftEatSuccessWin.cs
index 7756c8f..e6df721 100644
--- a/Main/System/HeroUI/HeroGiftEatSuccessWin.cs
+++ b/Main/System/HeroUI/HeroGiftEatSuccessWin.cs
@@ -53,7 +53,7 @@
//涓婇樀灞炴��
- int valuePer = hero.GetOnBattleAddPer();
+ int valuePer = hero.GetAddPer();
for (int i = 0; i < attrPerTextArr.Length; i++)
{
int id = PlayerPropertyConfig.basePerAttrs[i];
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index e956c8d..9b6bf0c 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -12,12 +12,13 @@
[SerializeField] Text heroPackText;
[SerializeField] ScrollerController heroListScroller;
[SerializeField] GameObject heroListEmpty;
- [SerializeField] List<Text> attrOnList; //涓婇樀灞炴�у姞鎴�
+ [SerializeField] List<Text> attrOnList; //鍏ㄤ綋灞炴�у姞鎴�
[SerializeField] GameObject attrOnTip;
[SerializeField] Button attrOnTipBtn;
[SerializeField] Button changeHeroPosBtn; //甯冮樀鎸夐挳
- [SerializeField] HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
+ [SerializeField] Transform heroSelectBehaviour;
+ HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
SinglePack singlePack;
@@ -37,23 +38,24 @@
{
attrOnTip.SetActive(!attrOnTip.activeSelf);
});
+
+ fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
}
protected override void OnPreOpen()
{
- HeroUIManager.Instance.selectHeroListJob = 0;
- HeroUIManager.Instance.selectHeroListCountry = 0;
singlePack = PackManager.Instance.GetSinglePack(PackType.Hero);
heroListScroller.OnRefreshCell += OnRefreshCell;
PackManager.Instance.gridRefreshEvent += GridRefreshEvent;
PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
UIManager.Instance.OnCloseWindow += OnCloseWindow;
- HeroManager.Instance.onHeroDeleteEvent += HeroDeleteEvent;
+ // HeroManager.Instance.onHeroDeleteEvent += HeroDeleteEvent;
HeroUIManager.Instance.SortHeroList();
UIManager.Instance.OnOpenWindow += OnOpenWindow;
- CreateScroller();
+ // CreateScroller();
Refresh();
+ fiterManager.Display(0, SelectJobCountry);
}
protected override void OnPreClose()
@@ -62,7 +64,7 @@
PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
PackManager.Instance.gridRefreshEvent -= GridRefreshEvent;
UIManager.Instance.OnCloseWindow -= OnCloseWindow;
- HeroManager.Instance.onHeroDeleteEvent -= HeroDeleteEvent;
+ // HeroManager.Instance.onHeroDeleteEvent -= HeroDeleteEvent;
UIManager.Instance.OnOpenWindow -= OnOpenWindow;
}
@@ -72,6 +74,7 @@
//鍏朵粬姝﹀皢鍔熻兘浜х敓鏁版嵁鍙樺寲锛岄渶瑕佸埛鏂版灏嗗垪琛�
if (closeUI is HeroTrainWin ||
closeUI is HeroCallWin ||
+ closeUI is HeroDeleteWin ||
closeUI is HeroPosWin)
{
HeroUIManager.Instance.SortHeroList();
@@ -117,15 +120,15 @@
RefreshPackCount();
- fiterManager.Display(0, HeroUIManager.Instance.selectHeroListJob, HeroUIManager.Instance.selectHeroListCountry, SelectJobCountry);
+
}
- void HeroDeleteEvent(int heroID)
- {
- HeroUIManager.Instance.SortHeroList();
- heroListScroller.m_Scorller.RefreshActiveCellViews();
- }
+ // void HeroDeleteEvent(int heroID)
+ // {
+ // HeroUIManager.Instance.SortHeroList();
+ // heroListScroller.m_Scorller.RefreshActiveCellViews();
+ // }
@@ -144,10 +147,10 @@
}
}
- void SelectJobCountry(int job, int country)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ void SelectJobCountry(List<int> selects)
{
- HeroUIManager.Instance.selectHeroListJob = job;
- HeroUIManager.Instance.selectHeroListCountry = country;
+ HeroUIManager.Instance.selectHeroList = selects;
HeroUIManager.Instance.SortHeroList();
RefreshEmptyTip();
CreateScroller();
@@ -156,23 +159,23 @@
//涓婇樀鍔犳垚
void OnBattleTeamAttrPer()
{
- var valuePer = 0;
- var team = TeamManager.Instance.GetTeam(TeamType.Story);
- if (team != null)
- {
- for (int i = 0; i < team.serverHeroes.Length; i++)
- {
- if (team.serverHeroes[i] == null)
- continue;
- var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid);
- if (hero != null)
- {
- valuePer += hero.GetOnBattleAddPer();
- }
- }
+ var valuePer = HeroUIManager.Instance.GetAllHeroPer();
+ // var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ // if (team != null)
+ // {
+ // for (int i = 0; i < team.serverHeroes.Length; i++)
+ // {
+ // if (team.serverHeroes[i] == null)
+ // continue;
+ // var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid);
+ // if (hero != null)
+ // {
+ // valuePer += hero.GetAddPer();
+ // }
+ // }
- }
- //涓婇樀灞炴��
+ // }
+ //鍏ㄤ綋灞炴��
for (int i = 0; i < attrOnList.Count; i++)
{
attrOnList[i].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.basePerAttrs[i], valuePer));
@@ -181,23 +184,66 @@
void OnRefreshCell(ScrollerDataType type, CellView cell)
{
- var _cell = cell as HeroCardLineCell;
- _cell.Display(cell.index);
+ if (type == ScrollerDataType.Header)
+ {
+ var _cell1 = cell as HeroCardLineTipCell;
+ _cell1.Display(cell.index);
+ }
+ else
+ {
+ var _cell = cell as HeroCardLineCell;
+ _cell.Display(cell.index, activeCount);
+ }
}
+
+ int activeCount;
void CreateScroller()
{
heroListScroller.Refresh();
- for (int i = 0; i < HeroUIManager.Instance.heroSortList.Count; i++)
+ heroListScroller.AddCell(ScrollerDataType.Header, 0);
+ activeCount = GetAttrActiveHeroCount();
+ for (int i = 0; i < activeCount; i++)
{
if (i % 4 == 0)
{
- heroListScroller.AddCell(ScrollerDataType.Header, i);
+ heroListScroller.AddCell(ScrollerDataType.Normal, i);
+ }
+ }
+ heroListScroller.AddCell(ScrollerDataType.Header, 1);
+ var unActiveCount = HeroUIManager.Instance.heroSortList.Count - activeCount;
+ for (int i = 0; i < unActiveCount; i++)
+ {
+ if (i % 4 == 0)
+ {
+ //鍔�10000 琛ㄧず鏈敓鏁�
+ heroListScroller.AddCell(ScrollerDataType.Normal, 10000 + activeCount + i);
}
}
heroListScroller.Restart();
}
+ int GetAttrActiveHeroCount()
+ {
+ int count = 0;
+ for (int i = 0; i < HeroUIManager.Instance.heroSortList.Count; i++)
+ {
+ var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroSortList[i]);
+ if (hero == null)
+ continue;
+ if (hero.isAttrActive)
+ {
+ count++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ return count;
+ }
+
+
void RefreshItemEvent(PackType type, int index, int itemID)
{
if (type != PackType.Hero)
diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index 16beb3c..e0e80c8 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -28,7 +28,8 @@
[SerializeField] Transform heroListEmpty;
[SerializeField] Toggle showConnTipToggleBtn;
- [SerializeField] HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
+ [SerializeField] Transform heroSelectBehaviour;
+ HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
[SerializeField] Button oneKeyOnBtn; //涓�閿笂闃�
[SerializeField] Button saveBtn; //淇濆瓨闃靛瀷
@@ -105,20 +106,19 @@
});
m_IsToggleOn = LocalSave.GetBool("ShowConn" + PlayerDatas.Instance.baseData.PlayerID, false);
+ fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
}
protected override void OnPreOpen()
{
- HeroUIManager.Instance.selectTeamPosJob = 0;
- HeroUIManager.Instance.selectTeamPosCountry = 0;
HeroUIManager.Instance.SortHeroOnTeamList();
heroListScroller.OnRefreshCell += OnRefreshCell;
HeroUIManager.Instance.OnTeamPosChangeEvent += TeamChangeEvent;
TeamManager.Instance.OnTeamChange += OnTeamChange;
ShowFuncBtn();
SelectTiltleBtn();
- CreateScroller();
+ // CreateScroller();
Display();
}
@@ -163,7 +163,7 @@
showConnTipToggleBtn.isOn = isToggleOn;
- fiterManager.Display(0, HeroUIManager.Instance.selectTeamPosJob, HeroUIManager.Instance.selectTeamPosCountry, SelectJobCountry);
+ fiterManager.Display(0, SelectJobCountry);
fightPowerText.text = UIHelper.ReplaceLargeArtNum(FightPowerManager.Instance.GetTeamFightPower(HeroUIManager.Instance.selectTeamType, true));
@@ -189,10 +189,10 @@
CancelCurrentTask();
}
- void SelectJobCountry(int job, int country)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ void SelectJobCountry(List<int> selects)
{
- HeroUIManager.Instance.selectTeamPosJob = job;
- HeroUIManager.Instance.selectTeamPosCountry = country;
+ HeroUIManager.Instance.selectListTeamPos = selects;
HeroUIManager.Instance.SortHeroOnTeamList();
CreateScroller();
RefreshEmptyTip();
@@ -245,7 +245,7 @@
var hero = HeroManager.Instance.GetHero(team.tempHeroes[i].guid);
if (hero != null)
{
- valuePer += hero.GetOnBattleAddPer();
+ valuePer += hero.GetAddPer();
}
}
@@ -510,8 +510,7 @@
{
return;
}
- HeroUIManager.Instance.selectTeamPosJob = 0;
- HeroUIManager.Instance.selectTeamPosCountry = 0;
+
HeroUIManager.Instance.selectTeamType = type;
HeroUIManager.Instance.SortHeroOnTeamList();
Display();
diff --git a/Main/System/HeroUI/HeroSelectBehaviour.cs b/Main/System/HeroUI/HeroSelectBehaviour.cs
index da85036..61b2213 100644
--- a/Main/System/HeroUI/HeroSelectBehaviour.cs
+++ b/Main/System/HeroUI/HeroSelectBehaviour.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
@@ -10,17 +11,25 @@
[SerializeField] Button foldBtn; //鏀惰捣鎸夐挳
[SerializeField] Transform foldForm; //鏀惰捣瀹瑰櫒
[SerializeField] Button unFoldBtn; //灞曞紑鎸夐挳
- [SerializeField] GroupButtonEx[] jobsBtn;
- [SerializeField] GroupButtonEx[] countrysBtn;
- [SerializeField] GroupButtonExManager jobManager;
- [SerializeField] GroupButtonExManager countryManager;
+ [SerializeField] Toggle[] jobsBtn;
+ [SerializeField] Toggle[] countrysBtn;
+ [SerializeField] Toggle[] hurtTypeBtn;
+ [SerializeField] Toggle[] specialType6Btn;
+ [SerializeField] Transform specialTypeMoreRect;
+ [SerializeField] ClickScreenOtherSpaceEvent clickScreenOtherSpaceEvent;
+ [SerializeField] Button resetBtn;
- int m_Job = 0;
- int m_Country = 0;
+ Toggle[] specialTypeMoreBtn;
+
+ int m_Job = 0; //鑱屼笟 澶氶�夐」鎸変綅瀛樺偍
+ int m_Country = 0; //鍥藉 澶氶�夐」浣嶆寜瀛樺偍
+ int m_HurtType = 0; //浼ゅ绫诲瀷 澶氶�夐」浣嶆寜瀛樺偍
+ int m_SpecialType6 = 0; //6澶ф垬鏂楀睘鎬� 澶氶�夐」浣嶆寜瀛樺偍
+ int m_SpecialTypeMore = 0; //鐗规畩灞炴�� 澶氶�夐」浣嶆寜瀛樺偍
int foldState = 0; //0 鏀惰捣锛�1 灞曞紑
//鐐瑰嚮鎸夐挳闇�閫氱煡鍝嶅簲澶栭儴浜嬩欢
- private Action<int, int> selectAction;
+ private Action<List<int>> selectAction;
@@ -38,80 +47,190 @@
RefreshFolState();
});
+ specialTypeMoreBtn = specialTypeMoreRect.GetComponentsInChildren<Toggle>();
+
+ // 鍒濆鍖栫壒娈婂睘鎬ф寜閽殑鏄剧ず鍜屾枃鏈�
+ for (int i = 0; i < specialTypeMoreBtn.Length; i++)
+ {
+ if (i < HeroUIManager.Instance.heroSpecialAttrsForSelect.Count)
+ {
+ int index = HeroUIManager.Instance.heroSpecialAttrsForSelect[i];
+ specialTypeMoreBtn[i].SetActive(true);
+ specialTypeMoreBtn[i].GetComponentInChildren<Text>().text = Language.Get($"HeroSpecialty2_{index}");
+ }
+ else
+ {
+ specialTypeMoreBtn[i].SetActive(false);
+ }
+ }
+
+ // 娣诲姞鎵�鏈塗oggle鐩戝惉鍣�
+ AddAllListeners();
+
+ clickScreenOtherSpaceEvent.AddListener(() =>
+ {
+ if (foldState == 0)
+ return;
+ foldBtn.onClick.Invoke();
+ });
+
+ resetBtn.AddListener(Reset);
+
+ }
+
+ // 绉婚櫎鎵�鏈塗oggle鐩戝惉鍣�
+ void RemoveAllListeners()
+ {
for (int i = 0; i < jobsBtn.Length; i++)
{
- int index = i;
- jobsBtn[i].AddListener(() =>
+ jobsBtn[i].onValueChanged.RemoveAllListeners();
+ }
+ for (int i = 0; i < countrysBtn.Length; i++)
+ {
+ countrysBtn[i].onValueChanged.RemoveAllListeners();
+ }
+ for (int i = 0; i < hurtTypeBtn.Length; i++)
+ {
+ hurtTypeBtn[i].onValueChanged.RemoveAllListeners();
+ }
+ for (int i = 0; i < specialType6Btn.Length; i++)
+ {
+ specialType6Btn[i].onValueChanged.RemoveAllListeners();
+ }
+ for (int i = 0; i < specialTypeMoreBtn.Length; i++)
+ {
+ specialTypeMoreBtn[i].onValueChanged.RemoveAllListeners();
+ }
+ }
+
+ // 娣诲姞鎵�鏈塗oggle鐩戝惉鍣�
+ void AddAllListeners()
+ {
+ for (int i = 0; i < jobsBtn.Length; i++)
+ {
+ int index = i + 1;
+ jobsBtn[i].onValueChanged.AddListener((bool value) =>
{
- m_Job = index;
- RefreshJobsBtn();
- selectAction?.Invoke(m_Job, m_Country);
+ m_Job = value ? m_Job | (1 << index) : m_Job & ~(1 << index);
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
});
}
for (int i = 0; i < countrysBtn.Length; i++)
{
- int index = i;
- countrysBtn[i].AddListener(() =>
+ int index = i + 1;
+ countrysBtn[i].onValueChanged.AddListener((bool value) =>
{
- m_Country = index;
- RefreshCountryBtn();
- selectAction?.Invoke(m_Job, m_Country);
+ m_Country = value ? m_Country | (1 << index) : m_Country & ~(1 << index);
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
});
}
+ for (int i = 0; i < hurtTypeBtn.Length; i++)
+ {
+ int index = i + 1;
+ hurtTypeBtn[i].onValueChanged.AddListener((bool value) =>
+ {
+ m_HurtType = value ? m_HurtType | (1 << index) : m_HurtType & ~(1 << index);
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
+ });
+ }
+
+ for (int i = 0; i < specialType6Btn.Length; i++)
+ {
+ int index = i + 1;
+ specialType6Btn[i].onValueChanged.AddListener((bool value) =>
+ {
+ m_SpecialType6 = value ? m_SpecialType6 | (1 << index) : m_SpecialType6 & ~(1 << index);
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
+ });
+ }
+
+ for (int i = 0; i < specialTypeMoreBtn.Length; i++)
+ {
+ if (i < HeroUIManager.Instance.heroSpecialAttrsForSelect.Count)
+ {
+ int index = HeroUIManager.Instance.heroSpecialAttrsForSelect[i];
+ specialTypeMoreBtn[i].onValueChanged.AddListener((bool value) =>
+ {
+ m_SpecialTypeMore = value ? m_SpecialTypeMore | (1 << index) : m_SpecialTypeMore & ~(1 << index);
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
+ });
+ }
+ }
}
/// <summary>
/// 鍥藉鑱屼笟绛涢��
/// </summary>
/// <param name="state"> 0鏀惰捣锛�1灞曞紑</param>
- /// <param name="job"></param>
- /// <param name="country"></param>
/// <param name="onRefresh"> 鐐瑰嚮鎸夐挳闇�閫氱煡鍝嶅簲澶栭儴浜嬩欢</param>
- public void Display(int state, int job, int country, Action<int, int> onRefresh)
+ /// 鍥炶皟鍙傛暟锛� 鑱屼笟锛屽浗瀹讹紝浼ゅ绫诲瀷锛�6澶ф垬鏂楀睘鎬э紝鐗规畩灞炴��
+ public void Display(int state, Action<List<int>> onRefresh)
{
foldState = state;
- m_Job = job;
- m_Country = country;
RefreshFolState();
- RefreshJobsBtn();
- RefreshCountryBtn();
selectAction = onRefresh;
+ Reset();
}
- //鍒锋柊鍏ㄩ儴鍒嗙被
- void RefreshJobsBtn()
- {
- jobManager.SelectButton(jobsBtn[m_Job]);
- }
- //鍒锋柊鍏ㄩ儴鍒嗙被
- void RefreshCountryBtn()
- {
- countryManager.SelectButton(countrysBtn[m_Country]);
- }
+
//鍒锋柊灞曞紑鏀惰捣鐘舵��
void RefreshFolState()
{
unFoldForm.SetActive(foldState == 1);
foldForm.SetActive(foldState == 0);
- }
-
-
- private void LateUpdate()
- {
- if (foldState == 0)
- return;
- if (Input.GetMouseButtonDown(0))
+ if (foldState == 1)
{
- if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, Input.mousePosition, CameraManager.uiCamera))
- {
- foldBtn.onClick.Invoke();
- }
+ UIHelper.ForceRefreshLayout(unFoldForm).Forget();
}
}
+
+ public static HeroSelectBehaviour Create(Transform heroSelectBehaviour)
+ {
+ var instanceGO = UIUtility.CreateWidget("HeroSelectBehaviour", "HeroSelectBehaviour");
+ instanceGO.transform.SetParentEx(heroSelectBehaviour, Vector3.zero, Quaternion.identity, Vector3.one);
+ return instanceGO.GetComponent<HeroSelectBehaviour>();
+ }
+
+ void Reset()
+ {
+ // 鏆傛椂绉婚櫎鎵�鏈夌洃鍚櫒閬垮厤閲嶇疆鏃跺娆¤Е鍙�
+ RemoveAllListeners();
+
+ m_Job = 0;
+ m_Country = 0;
+ m_HurtType = 0;
+ m_SpecialType6 = 0;
+ m_SpecialTypeMore = 0;
+
+ for (int i = 0; i < jobsBtn.Length; i++)
+ {
+ jobsBtn[i].isOn = false;
+ }
+ for (int i = 0; i < countrysBtn.Length; i++)
+ {
+ countrysBtn[i].isOn = false;
+ }
+ for (int i = 0; i < hurtTypeBtn.Length; i++)
+ {
+ hurtTypeBtn[i].isOn = false;
+ }
+ for (int i = 0; i < specialType6Btn.Length; i++)
+ {
+ specialType6Btn[i].isOn = false;
+ }
+ for (int i = 0; i < specialTypeMoreBtn.Length; i++)
+ {
+ specialTypeMoreBtn[i].isOn = false;
+ }
+
+ // 閲嶆柊娣诲姞鐩戝惉鍣�
+ AddAllListeners();
+ selectAction?.Invoke(new List<int>() { m_Job, m_Country, m_HurtType, m_SpecialType6, m_SpecialTypeMore });
+ }
}
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 9e97cf8..c7b2f20 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -440,7 +440,7 @@
inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], hero.heroConfig.HPInheritPer));
//涓婇樀灞炴��
- int valuePer = hero.GetOnBattleAddPer();
+ int valuePer = hero.GetAddPer();
for (int i = 0; i < heroAddAttrPerText.Length; i++)
{
heroAddAttrPerText[i].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.basePerAttrs[i], valuePer));
diff --git a/Main/System/HeroUI/HeroUIManager.Collect.cs b/Main/System/HeroUI/HeroUIManager.Collect.cs
index ce72014..03caf26 100644
--- a/Main/System/HeroUI/HeroUIManager.Collect.cs
+++ b/Main/System/HeroUI/HeroUIManager.Collect.cs
@@ -12,8 +12,7 @@
public Dictionary<int, List<int>> heroCollectDict { get; private set; } = new Dictionary<int, List<int>>(); //姝﹀皢鍥鹃壌鎸夊搧璐ㄥ垪琛�
public List<int> heroCollectList = new List<int>(); //姝﹀皢鍥鹃壌鍒楄〃
- public int selectHeroCollectListJob = 0; //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
- public int selectHeroCollectListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
+ public List<int> selectHeroCollectList = new List<int>(); //姝﹀皢鍒楄〃鐣岄潰 绛涢��
public int selectCollectHeroID; //閫変腑鐨勬灏唅d 鐢ㄤ簬鍗囩骇
public int selectForPreviewHeroID; //閫変腑鐨勬灏唅d 鐢ㄤ簬棰勮
@@ -21,7 +20,7 @@
//鍥鹃壌鍜岀毊鑲ょ殑婵�娲绘儏鍐�
Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>();
- public int allHeroBookPer; //鍏ㄤ綋姝﹀皢鐨勫浘閴存縺娲荤櫨鍒嗘瘮
+ // public int allHeroBookPer; //鍏ㄤ綋姝﹀皢鐨勫浘閴存縺娲荤櫨鍒嗘瘮
public event Action OnHeroCollectEvent;
public void UpdateHeroCollectInfo(HB122_tagSCHeroInfo netPack)
@@ -30,26 +29,26 @@
{
heroCollectInfoDic[(int)netPack.HeroInfoList[i].HeroID] = netPack.HeroInfoList[i];
}
- allHeroBookPer = GetHeroCollectBookPer();
+ // allHeroBookPer = GetHeroCollectBookPer();
OnHeroCollectEvent?.Invoke();
UpdateHeroBookRedpoint();
}
- public int GetHeroCollectBookPer()
- {
- int per = 0;
- foreach (var kv in heroCollectInfoDic)
- {
- var config = HeroQualityConfig.Get(HeroConfig.Get(kv.Key).Quality);
- if (kv.Value.BookInitState != 2)
- continue;
- per += config.BookInitAddPer;
- per += kv.Value.BookStarLV * config.BookStarAddPer;
- per += kv.Value.BookBreakLV * config.BookBreakLVAddPer;
- }
- return per;
- }
+ // public int GetHeroCollectBookPer()
+ // {
+ // int per = 0;
+ // foreach (var kv in heroCollectInfoDic)
+ // {
+ // var config = HeroQualityConfig.Get(HeroConfig.Get(kv.Key).Quality);
+ // if (kv.Value.BookInitState != 2)
+ // continue;
+ // per += config.BookInitAddPer;
+ // per += kv.Value.BookStarLV * config.BookStarAddPer;
+ // per += kv.Value.BookBreakLV * config.BookBreakLVAddPer;
+ // }
+ // return per;
+ // }
public bool TryGetHeroBookInfo(int heroID, out HB122_tagSCHeroInfo.tagSCHero heroData)
{
@@ -65,7 +64,22 @@
public void SortHeroCollectList()
{
+
var heroIDs = HeroConfig.GetKeys().ToList();
+
+ int job = 0;
+ int country = 0;
+ int hurtType = 0;
+ int fightAttrType = 0;
+ int specialAttrType = 0;
+ if (!selectHeroCollectList.IsNullOrEmpty())
+ {
+ job = selectHeroCollectList[0];
+ country = selectHeroCollectList[1];
+ hurtType = selectHeroCollectList[2];
+ fightAttrType = selectHeroCollectList[3];
+ specialAttrType = selectHeroCollectList[4];
+ }
heroCollectDict.Clear();
foreach (var heroID in heroIDs)
@@ -77,12 +91,37 @@
{
heroCollectDict[heroConfig.Quality] = new List<int>();
}
- //杩囨护鑱屼笟鍥藉
- if (selectHeroCollectListJob != 0 && selectHeroCollectListJob != heroConfig.Class)
+
+ //0浠h〃鍏ㄩ儴, 鍚岀骇鍒槸鍙閫夛紝涓嶅悓绾у埆涓轰笖鐨勫叧绯�
+ bool isMatch = true;
+ if (job != 0)
{
- continue;
+ isMatch = isMatch && (job & (1 << heroConfig.Class)) > 0;
}
- if (selectHeroCollectListCountry != 0 && selectHeroCollectListCountry != heroConfig.Country)
+ if (country != 0)
+ {
+ isMatch = isMatch && (country & (1 << heroConfig.Country)) > 0;
+ }
+ if (hurtType != 0)
+ {
+ isMatch = isMatch && (hurtType & (1 << heroConfig.HurtType)) > 0;
+ }
+ if (fightAttrType != 0)
+ {
+ isMatch = isMatch && (fightAttrType & (1 << heroConfig.Specialty)) > 0;
+ }
+ if (specialAttrType != 0)
+ {
+ bool isMatch2 = false;
+ for (int i = 0; i < heroConfig.Specialty2.Length; i++)
+ {
+ isMatch2 = (specialAttrType & (1 << heroConfig.Specialty2[i])) > 0;
+ if (isMatch2)
+ break;
+ }
+ isMatch = isMatch && isMatch2;
+ }
+ if (!isMatch)
{
continue;
}
@@ -122,8 +161,8 @@
HB122_tagSCHeroInfo.tagSCHero colData;
TryGetHeroBookInfo(heroID, out colData);
- int maxBreakLV = colData.BookBreakLVH; //鍘嗗彶鏈�楂樼獊鐮寸瓑绾�
- int maxStarLV = colData.BookStarLVH; //鍘嗗彶鏈�楂樻槦绾�
+ // int maxBreakLV = colData.BookBreakLVH; //鍘嗗彶鏈�楂樼獊鐮寸瓑绾�
+ // int maxStarLV = colData.BookStarLVH; //鍘嗗彶鏈�楂樻槦绾�
if (colData.BookInitState == 0)
{
@@ -133,30 +172,35 @@
{
funcState = 1;
}
- else if (colData.BookInitState == 2)
+ else
{
- if (GetHeroBookMaxLevel(heroID, quality) == colData.BookBreakLV + colData.BookStarLV)
- {
- funcState = 5;
- }
- else if (maxBreakLV + maxStarLV == colData.BookBreakLV + colData.BookStarLV)
- {
- funcState = 2;
- }
- else
- {
- //浼樺厛绐佺牬鍗囩骇
- if (colData.BookBreakLV < colData.BookBreakLVH)
- {
- funcState = 3;
- }
- else
- {
- funcState = 4;
- }
- }
-
+ funcState = 2;
}
+
+ // else if (colData.BookInitState == 2)
+ // {
+ // if (GetHeroBookMaxLevel(heroID, quality) == colData.BookBreakLV + colData.BookStarLV)
+ // {
+ // funcState = 5;
+ // }
+ // else if (maxBreakLV + maxStarLV == colData.BookBreakLV + colData.BookStarLV)
+ // {
+ // funcState = 2;
+ // }
+ // else
+ // {
+ // //浼樺厛绐佺牬鍗囩骇
+ // if (colData.BookBreakLV < colData.BookBreakLVH)
+ // {
+ // funcState = 3;
+ // }
+ // else
+ // {
+ // funcState = 4;
+ // }
+ // }
+
+ // }
return funcState;
}
@@ -176,16 +220,16 @@
return 0;
}
- public int GetHeroBookPer(int heroID)
- {
- var config = HeroQualityConfig.Get(HeroConfig.Get(heroID).Quality);
- HB122_tagSCHeroInfo.tagSCHero heroData;
- TryGetHeroBookInfo(heroID, out heroData);
- if (heroData.BookInitState < 2)
- {
- return 0;
- }
- return config.BookInitAddPer + heroData.BookStarLV * config.BookStarAddPer + heroData.BookBreakLV * config.BookBreakLVAddPer;
- }
+ // public int GetHeroBookPer(int heroID)
+ // {
+ // var config = HeroQualityConfig.Get(HeroConfig.Get(heroID).Quality);
+ // HB122_tagSCHeroInfo.tagSCHero heroData;
+ // TryGetHeroBookInfo(heroID, out heroData);
+ // if (heroData.BookInitState < 2)
+ // {
+ // return 0;
+ // }
+ // return config.BookInitAddPer + heroData.BookStarLV * config.BookStarAddPer + heroData.BookBreakLV * config.BookBreakLVAddPer;
+ // }
}
diff --git a/Main/System/HeroUI/HeroUIManager.OnTeam.cs b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
index 6882909..6fb8cb2 100644
--- a/Main/System/HeroUI/HeroUIManager.OnTeam.cs
+++ b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
@@ -29,8 +29,7 @@
}
}
- public int selectTeamPosJob = 0; //甯冮樀鐣岄潰 绛涢�夎亴涓�
- public int selectTeamPosCountry = 0; //甯冮樀鐣岄潰 绛涢�夊浗瀹�
+ public List<int> selectListTeamPos = new List<int>(); //甯冮樀鐣岄潰 绛涢�夋潯浠�
public const float clickFlyPosTime = 0.5f; //鐐瑰嚮鍒楄〃涓殑姝﹀皢鍥炬爣鏃�, 椋炲叆甯冮樀鐨勬椂闂�
@@ -50,41 +49,41 @@
/// <param name="type"></param>
/// <param name="isPreview">true 瀹㈡埛绔瑙堥樀瀹癸紝榛樿false 鏈嶅姟鍣ㄩ樀瀹�</param>
/// <returns></returns>
- public Dictionary<string, int> GetLineupPer(TeamType type, bool isPreview = false)
- {
- Dictionary<string, int> lineUPPer = new Dictionary<string, int>()
- {
- {"lineupInitAddPer", 0},
- {"lineupLVAddPer", 0},
- {"lineupBreakLVAddPer", 0},
- {"lineupStarAddPer", 0},
- };
+ // public Dictionary<string, int> GetLineupPer(TeamType type, bool isPreview = false)
+ // {
+ // Dictionary<string, int> lineUPPer = new Dictionary<string, int>()
+ // {
+ // {"lineupInitAddPer", 0},
+ // {"lineupLVAddPer", 0},
+ // {"lineupBreakLVAddPer", 0},
+ // {"lineupStarAddPer", 0},
+ // };
- var team = TeamManager.Instance.GetTeam(type);
- if (team == null)
- {
- return lineUPPer;
- }
- TeamHero[] teamHeroes = isPreview ? team.tempHeroes : team.serverHeroes;
+ // var team = TeamManager.Instance.GetTeam(type);
+ // if (team == null)
+ // {
+ // return lineUPPer;
+ // }
+ // TeamHero[] teamHeroes = isPreview ? team.tempHeroes : team.serverHeroes;
- foreach (var teamHero in teamHeroes)
- {
- if (teamHero == null)
- {
- continue;
- }
- var config = HeroQualityConfig.Get(HeroConfig.Get(teamHero.heroId).Quality);
- lineUPPer["lineupInitAddPer"] += config.InitAddPer;
+ // foreach (var teamHero in teamHeroes)
+ // {
+ // if (teamHero == null)
+ // {
+ // continue;
+ // }
+ // var config = HeroQualityConfig.Get(HeroConfig.Get(teamHero.heroId).Quality);
+ // lineUPPer["lineupInitAddPer"] += config.InitAddPer;
- HeroInfo hero = HeroManager.Instance.GetHero(teamHero.guid);
- if (hero == null) continue;
- lineUPPer["lineupLVAddPer"] += hero.GetLineupLVAddPer();
- lineUPPer["lineupBreakLVAddPer"] += hero.GetLineupBreakLVAddPer();
- lineUPPer["lineupStarAddPer"] += hero.GetLineupStarAddPer();
+ // HeroInfo hero = HeroManager.Instance.GetHero(teamHero.guid);
+ // if (hero == null) continue;
+ // lineUPPer["lineupLVAddPer"] += hero.GetLineupLVAddPer();
+ // lineUPPer["lineupBreakLVAddPer"] += hero.GetLineupBreakLVAddPer();
+ // lineUPPer["lineupStarAddPer"] += hero.GetLineupStarAddPer();
- }
- return lineUPPer;
- }
+ // }
+ // return lineUPPer;
+ // }
/// <summary>
/// 鎸夐槦浼嶈幏寰楅樀鍨嬶紙鍥藉鍏夌幆锛夊睘鎬�
@@ -110,7 +109,7 @@
public void SortHeroOnTeamList()
{
- heroOnTeamSortList = HeroManager.Instance.GetHeroGuidList(selectTeamPosJob, selectTeamPosCountry);
+ heroOnTeamSortList = HeroManager.Instance.GetHeroGuidList(selectListTeamPos);
heroOnTeamSortList.Sort(CmpHeroByTeamType);
}
diff --git a/Main/System/HeroUI/HeroUIManager.Reborn.cs b/Main/System/HeroUI/HeroUIManager.Reborn.cs
index d2e8355..44f1843 100644
--- a/Main/System/HeroUI/HeroUIManager.Reborn.cs
+++ b/Main/System/HeroUI/HeroUIManager.Reborn.cs
@@ -17,9 +17,7 @@
public int deletePayBackPer; //閬f暎杩旇繕鐨勭櫨鍒嗘瘮
public List<string> heroDeleteSortList { get; private set; } = new List<string>();
- public int selectHeroDeleteListJob = 0; //绛涢�夎亴涓�
- public int selectHeroDeleteListCountry = 0; //绛涢�夊浗瀹�
-
+ public List<int> selectHeroDeleteList = new List<int>(); //绛涢��
public List<string> selectDeleteHeroList { get; private set; } = new List<string>();
public string jumpDeleteHeroGuid;
@@ -104,7 +102,7 @@
public void SortHeroDeleteList()
{
- heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteListJob, selectHeroDeleteListCountry);
+ heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteList);
heroDeleteSortList.Sort(CmpDeleteHero);
}
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 0d18016..84e6627 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -12,8 +12,7 @@
{
#region 姝﹀皢鍒楄〃鐣岄潰
public List<string> heroSortList { get; private set; } = new List<string>(); //涓婇樀涓轰富绾跨殑 GUID鍒楄〃
- public int selectHeroListJob = 0; //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
- public int selectHeroListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
+ public List<int> selectHeroList = new List<int>(); //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
public string selectHeroGuid; //閫変腑鐨勬灏唅d
public int[] heroRedpointItemList; //鏈夊奖鍝嶇孩鐐圭殑閬撳叿
#endregion
@@ -31,6 +30,7 @@
public int firstHeroIDBookUpdate = 0; //鍥鹃壌涓涓�涓彲浠ュ崌绾ф垨鑰呭崌鏄熺殑姝﹀皢锛屽紩瀵肩敤
+ public List<int> heroSpecialAttrsForSelect = new List<int>(); //绛涢�夌敤鐨勭壒娈婂睘鎬ф眹鎬�
public override void Init()
{
@@ -43,7 +43,7 @@
QuickSetting.Instance.onQuickSettingUpdate += OnQuickSettingUpdate;
ParseConfig();
InitHeroOnTeamRedpointList();
- InitHeroBookRedpointList();
+ InitHerosData();
}
public override void Release()
@@ -208,6 +208,20 @@
return hero.heroLevel == GetMaxLVByBreakLV(hero.Quality, hero.breakLevel);
}
+ public int GetAllHeroPer()
+ {
+ var list = HeroManager.Instance.GetHeroList();
+ int per = 0;
+ foreach (var hero in list)
+ {
+ if (hero.isAttrActive)
+ {
+ per += hero.GetAddPer();
+ }
+ }
+ return per;
+ }
+
#endregion
@@ -240,7 +254,7 @@
//鍒锋柊鏃舵満, 鎵撳紑姝﹀皢鐣岄潰 鎴栬�� 鍏抽棴鍔熻兘鐣岄潰
public void SortHeroList()
{
- heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroListJob, selectHeroListCountry);
+ heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroList);
heroSortList.Sort(CmpHero);
}
@@ -252,6 +266,13 @@
if (heroA == null || heroB == null)
{
return 0;
+ }
+
+ bool isActiveA = heroA.isAttrActive;
+ bool isActiveB = heroB.isAttrActive;
+ if (isActiveA != isActiveB)
+ {
+ return isActiveA ? -1 : 1;
}
// 鎺掑簭瑙勫垯锛氫笂闃�>姝﹀皢绛夌骇锛炵獊鐮寸瓑绾э紴姝﹀皢瑙夐啋闃剁骇锛炴灏嗗搧璐紴姝﹀皢鍚炲櫖鏄熺骇锛炴灏咺D
@@ -286,7 +307,6 @@
}
-
#region 鎷涘嫙
public HappXBTitle selectCallType; //瀵诲疂鏋氫妇绫诲瀷
@@ -295,8 +315,7 @@
//绉垎鎷涘嫙棰勮
public List<int> heroCallSortList { get; private set; } = new List<int>(); //绉垎鎷涘嫙鍒楄〃
- public int selectHeroCallListJob = 0; //绛涢�夎亴涓�
- public int selectHeroCallListCountry = 0; //绛涢�夊浗瀹�
+ public List<int> selectHeroCallList = new List<int>(); //绛涢��
public List<int> newHeroIDList = new List<int>(); //鏂版灏嗗垪琛�
public bool IsNewHero(int heroID)
@@ -356,12 +375,28 @@
allHeroCallScoreList = HappyXBModel.Instance.GetAllGridLibItemIDByType((int)HappXBTitle.HeroCallScore);
}
heroCallSortList = new List<int>();
- if (selectHeroCallListJob == 0 && selectHeroCallListCountry == 0)
+ if (selectHeroCallList.IsNullOrEmpty())
{
heroCallSortList = allHeroCallScoreList;
}
else
{
+
+ int job = 0;
+ int country = 0;
+ int hurtType = 0;
+ int fightAttrType = 0;
+ int specialAttrType = 0;
+ if (!selectHeroCallList.IsNullOrEmpty())
+ {
+ job = selectHeroCallList[0];
+ country = selectHeroCallList[1];
+ hurtType = selectHeroCallList[2];
+ fightAttrType = selectHeroCallList[3];
+ specialAttrType = selectHeroCallList[4];
+ }
+
+
foreach (var item in allHeroCallScoreList)
{
HeroConfig heroConfig = HeroConfig.Get(item);
@@ -369,14 +404,41 @@
{
continue;
}
- if (selectHeroCallListJob != 0 && selectHeroCallListJob != heroConfig.Class)
+
+ //0浠h〃鍏ㄩ儴, 鍚岀骇鍒槸鍙閫夛紝涓嶅悓绾у埆涓轰笖鐨勫叧绯�
+ bool isMatch = true;
+ if (job != 0)
+ {
+ isMatch = isMatch && (job & (1 << heroConfig.Class)) > 0;
+ }
+ if (country != 0)
+ {
+ isMatch = isMatch && (country & (1 << heroConfig.Country)) > 0;
+ }
+ if (hurtType != 0)
+ {
+ isMatch = isMatch && (hurtType & (1 << heroConfig.HurtType)) > 0;
+ }
+ if (fightAttrType != 0)
+ {
+ isMatch = isMatch && (fightAttrType & (1 << heroConfig.Specialty)) > 0;
+ }
+ if (specialAttrType != 0)
+ {
+ bool isMatch2 = false;
+ for (int i = 0; i < heroConfig.Specialty2.Length; i++)
+ {
+ isMatch2 = (specialAttrType & (1 << heroConfig.Specialty2[i])) > 0;
+ if (isMatch2)
+ break;
+ }
+ isMatch = isMatch && isMatch2;
+ }
+ if (!isMatch)
{
continue;
}
- if (selectHeroCallListCountry != 0 && selectHeroCallListCountry != heroConfig.Country)
- {
- continue;
- }
+
heroCallSortList.Add(item);
}
}
@@ -507,16 +569,33 @@
}
- void InitHeroBookRedpointList()
+ void InitHerosData()
{
heroBookRedpointList.Clear();
foreach (var key in HeroConfig.GetKeys())
{
var config = HeroConfig.Get(key);
+
+ //姹囨�荤壒娈婂睘鎬�
+ if (!config.Specialty2.IsNullOrEmpty())
+ {
+ foreach (var num in config.Specialty2)
+ {
+ if (!heroSpecialAttrsForSelect.Contains(num))
+ {
+ heroSpecialAttrsForSelect.Add(num);
+ }
+ }
+ }
+
if (config.PlayerCanUse == 0)
continue;
+
+ //鍥鹃壌绾㈢偣
heroBookRedpointList.Add(new Redpoint(MainRedDot.HeroCardCollectRedpoint, MainRedDot.HeroCardCollectRedpoint * 10000000 + key));
}
+
+ heroSpecialAttrsForSelect.Sort();
}
diff --git a/Main/System/Main/FightPowerFormula.cs b/Main/System/Main/FightPowerFormula.cs
index 2bef83b..25d17af 100644
--- a/Main/System/Main/FightPowerFormula.cs
+++ b/Main/System/Main/FightPowerFormula.cs
@@ -5,23 +5,18 @@
// 鍙橀噺鍚嶅父閲忓畾涔�
private const string LVVALUE_VALUE = "lvValue";
private const string EQUIPVALUE_VALUE = "equipValue";
- private const string BOOKVALUE_VALUE = "bookValue";
private const string REALMVALUE_VALUE = "realmValue";
private const string GUBAOVALUE_VALUE = "gubaoValue";
private const string HJGVALUE_VALUE = "hjgValue";
private const string HORSEVALUE_VALUE = "horseValue";
private const string BEAUTYVALUE_VALUE = "beautyValue";
private const string LINEUPHALOPER_VALUE = "lineupHaloPer";
- private const string BOOKPER_VALUE = "bookPer";
private const string REALMPER_VALUE = "realmPer";
private const string GUBAOPER_VALUE = "gubaoPer";
private const string HJGPER_VALUE = "hjgPer";
private const string HORSEPER_VALUE = "horsePer";
private const string BEAUTYPER_VALUE = "beautyPer";
- private const string LINEUPINITADDPER_VALUE = "lineupInitAddPer";
- private const string LINEUPLVADDPER_VALUE = "lineupLVAddPer";
- private const string LINEUPBREAKLVADDPER_VALUE = "lineupBreakLVAddPer";
- private const string LINEUPSTARADDPER_VALUE = "lineupStarAddPer";
+ private const string CARDPER_VALUE = "cardPer";
private const string INHERITPER_VALUE = "inheritPer";
private const string FETTERPER_VALUE = "fetterPer";
private const string STARTALENTPER_VALUE = "starTalentPer";
@@ -124,9 +119,9 @@
private const string OFFICIALLV_VALUE = "OfficialLV";
// 鍩虹灞炴�у叕寮�
- // (lvValue+equipValue+bookValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)*(1+lineupHaloPer+bookPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+lineupInitAddPer+lineupLVAddPer+lineupBreakLVAddPer+lineupStarAddPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue
+ // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue
// 鎴樻枟灞炴�у叕寮�
- // (lvValue+equipValue+bookValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue
+ // (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue
// 鎴樻枟鍔涘叕寮�
// long(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio+PVPDamPer*PVPDamPerRatio+PVPDamPerDef*PVPDamPerDefRatio)/100.0-55000)
// 鎶�鑳芥垬鏂楀姏鍏紡
@@ -136,23 +131,18 @@
{
double lvValue = variables[LVVALUE_VALUE];
double equipValue = variables[EQUIPVALUE_VALUE];
- double bookValue = variables[BOOKVALUE_VALUE];
double realmValue = variables[REALMVALUE_VALUE];
double gubaoValue = variables[GUBAOVALUE_VALUE];
double hjgValue = variables[HJGVALUE_VALUE];
double horseValue = variables[HORSEVALUE_VALUE];
double beautyValue = variables[BEAUTYVALUE_VALUE];
double lineupHaloPer = variables[LINEUPHALOPER_VALUE];
- double bookPer = variables[BOOKPER_VALUE];
double realmPer = variables[REALMPER_VALUE];
double gubaoPer = variables[GUBAOPER_VALUE];
double hjgPer = variables[HJGPER_VALUE];
double horsePer = variables[HORSEPER_VALUE];
double beautyPer = variables[BEAUTYPER_VALUE];
- double lineupInitAddPer = variables[LINEUPINITADDPER_VALUE];
- double lineupLVAddPer = variables[LINEUPLVADDPER_VALUE];
- double lineupBreakLVAddPer = variables[LINEUPBREAKLVADDPER_VALUE];
- double lineupStarAddPer = variables[LINEUPSTARADDPER_VALUE];
+ double cardPer = variables[CARDPER_VALUE];
double inheritPer = variables[INHERITPER_VALUE];
double fetterPer = variables[FETTERPER_VALUE];
double starTalentPer = variables[STARTALENTPER_VALUE];
@@ -161,14 +151,13 @@
double heroSelfValue = variables[HEROSELFVALUE_VALUE];
double heroLVValue = variables[HEROLVVALUE_VALUE];
- return (lvValue+equipValue+bookValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)*(1+lineupHaloPer+bookPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+lineupInitAddPer+lineupLVAddPer+lineupBreakLVAddPer+lineupStarAddPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue;
+ return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+cardPer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)+heroSelfValue+heroLVValue;
}
public static double GetFightAttr(Dictionary<string, double> variables)
{
double lvValue = variables[LVVALUE_VALUE];
double equipValue = variables[EQUIPVALUE_VALUE];
- double bookValue = variables[BOOKVALUE_VALUE];
double realmValue = variables[REALMVALUE_VALUE];
double gubaoValue = variables[GUBAOVALUE_VALUE];
double hjgValue = variables[HJGVALUE_VALUE];
@@ -181,7 +170,7 @@
double awakeTalentValue = variables[AWAKETALENTVALUE_VALUE];
double fetterValue = variables[FETTERVALUE_VALUE];
- return (lvValue+equipValue+bookValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
+ return (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
}
public static double GetFightPower(Dictionary<string, double> variables)
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index aa20721..779d0cc 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -46,6 +46,7 @@
private const string FETTER_PER = "fetterPer";
private const string HERO_LV_VALUE = "heroLVValue";
private const string HERO_LV_PER = "heroLVPer";
+ private const string HERO_CARDPER = "cardPer";
// 鎴樺姏鍙橀噺甯搁噺
private const string ATK_RATIO = "AtkRatio";
@@ -143,8 +144,10 @@
//鍒嗗紑瀛樺偍棰勮鍜� 鐪熷疄灞炴��
public Dictionary<int, int> equipAttrs = new Dictionary<int, int>(); //瑁呭灞炴��
- public Dictionary<string, int> lineUpPerDict = new Dictionary<string, int>(); //闃靛灞炴�у姞鎴�
+ // public Dictionary<string, int> lineUpPerDict = new Dictionary<string, int>(); //闃靛灞炴�у姞鎴�
public Dictionary<int, int> countryAttrs = new Dictionary<int, int>(); //闃靛鍥藉锛堝厜鐜級灞炴��
+
+ float allHeroAddPer = 0; //鎵�鏈夋灏嗗姞鎴�
//绛夌骇灞炴��
void RefreshLVAttrs()
@@ -259,8 +262,8 @@
{
//闃靛灞炴��
// 闃靛锛氭墍鏈夋灏嗕笂闃靛睘鎬�
- lineUpPerDict = HeroUIManager.Instance.GetLineupPer(teamTypeCalc, isPreviewTeamPower);
-
+ // lineUpPerDict = HeroUIManager.Instance.GetLineupPer(teamTypeCalc, isPreviewTeamPower);
+ allHeroAddPer = HeroUIManager.Instance.GetAllHeroPer() / 10000.0f;
#if UNITY_EDITOR
// Debug.Log("鎴樺姏锛氫笂闃靛睘鎬� " + JsonMapper.ToJson(lineUpPerDict));
#endif
@@ -302,10 +305,10 @@
propertyVariables[LV_VALUE] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
propertyVariables[EQUIP_VALUE] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0;
- propertyVariables[BOOK_VALUE] = 0;
+ // propertyVariables[BOOK_VALUE] = 0;
propertyVariables[REALM_VALUE] = officialAttrs.ContainsKey(attrType) ? officialAttrs[attrType] : 0;
propertyVariables[REALM_PER] = GetOfficialPer(attrType) / 10000.0f;
- propertyVariables[BOOK_PER] = GetBookPer(attrType) / 10000.0f;
+ // propertyVariables[BOOK_PER] = GetBookPer(attrType) / 10000.0f;
propertyVariables[GUBAO_VALUE] = 0;
propertyVariables[GUBAO_PER] = 0;
propertyVariables[HJG_VALUE] = PhantasmPavilionManager.Instance.GetAttrValue(attrType);
@@ -315,11 +318,13 @@
propertyVariables[BEAUTY_VALUE] = 0;
propertyVariables[BEAUTY_PER] = 0;
+ //鍏ㄤ綋鍗$墝鍔犳垚
+ propertyVariables[HERO_CARDPER] = allHeroAddPer;
//锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
- propertyVariables[LINEUP_INIT_ADD_PER] = GetLineUpPer(attrType, LINEUP_INIT_ADD_PER) / 10000.0f;
- propertyVariables[LINEUP_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_LV_ADD_PER) / 10000.0f;
- propertyVariables[LINEUP_BREAK_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_BREAK_LV_ADD_PER) / 10000.0f;
- propertyVariables[LINEUP_STAR_ADD_PER] = GetLineUpPer(attrType, LINEUP_STAR_ADD_PER) / 10000.0f;
+ // propertyVariables[LINEUP_INIT_ADD_PER] = GetLineUpPer(attrType, LINEUP_INIT_ADD_PER) / 10000.0f;
+ // propertyVariables[LINEUP_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_LV_ADD_PER) / 10000.0f;
+ // propertyVariables[LINEUP_BREAK_LV_ADD_PER] = GetLineUpPer(attrType, LINEUP_BREAK_LV_ADD_PER) / 10000.0f;
+ // propertyVariables[LINEUP_STAR_ADD_PER] = GetLineUpPer(attrType, LINEUP_STAR_ADD_PER) / 10000.0f;
//闃靛鍏夌幆 涓夊洿鐧惧垎姣斿姞鎴�
propertyVariables[LINEUP_HALO_VALUE] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
@@ -354,24 +359,24 @@
- int GetLineUpPer(int attrType, string key)
- {
- if (!PlayerPropertyConfig.baseAttrs.Contains(attrType))
- {
- return 0;
- }
+ // int GetLineUpPer(int attrType, string key)
+ // {
+ // if (!PlayerPropertyConfig.baseAttrs.Contains(attrType))
+ // {
+ // return 0;
+ // }
- return lineUpPerDict[key];
- }
+ // return lineUpPerDict[key];
+ // }
- int GetBookPer(int attrType)
- {
- if (!PlayerPropertyConfig.baseAttrs.Contains(attrType))
- {
- return 0;
- }
- return HeroUIManager.Instance.allHeroBookPer;
- }
+ // int GetBookPer(int attrType)
+ // {
+ // if (!PlayerPropertyConfig.baseAttrs.Contains(attrType))
+ // {
+ // return 0;
+ // }
+ // return HeroUIManager.Instance.allHeroBookPer;
+ // }
int GetOfficialPer(int attrType)
{
diff --git a/Main/System/Main/HeroFightingCardCell.cs b/Main/System/Main/HeroFightingCardCell.cs
index 410c72c..b5b4d6d 100644
--- a/Main/System/Main/HeroFightingCardCell.cs
+++ b/Main/System/Main/HeroFightingCardCell.cs
@@ -118,8 +118,6 @@
void ClickHero()
{
- HeroUIManager.Instance.selectHeroListJob = 0;
- HeroUIManager.Instance.selectHeroListCountry = 0;
HeroUIManager.Instance.SortHeroList();
HeroUIManager.Instance.selectHeroGuid = guid;
UIManager.Instance.OpenWindow<HeroTrainWin>();
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 2cd0ea7..f907b9d 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -8,6 +8,7 @@
using System.Text.RegularExpressions;
using System.IO;
using LitJson;
+using Cysharp.Threading.Tasks;
/// <summary>
/// UI杈呭姪绫�
@@ -1423,11 +1424,33 @@
GUIUtility.systemCopyBuffer = text;
Debug.Log("鏂囧瓧宸插鍒跺埌鍓创鏉�: " + text);
}
-
+
//鑾峰彇鍓垏鏉垮唴瀹�
public static string GetClipboardText()
{
return GUIUtility.systemCopyBuffer;
}
+ /// <summary>
+ /// 寮哄埗鍒锋柊Layout锛岃В鍐冲祵濂桳ayout鍜孋ontentSizeFitter鐨勯噸鍙犻棶棰�
+ /// </summary>
+ public static async UniTask ForceRefreshLayout(Transform transform)
+ {
+ await UniTask.DelayFrame(2);
+ // 鍒锋柊鎵�鏈塋ayout缁勪欢
+ var layouts = transform.GetComponentsInChildren<LayoutGroup>(true);
+ foreach (var layout in layouts)
+ {
+ LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>());
+ }
+ await UniTask.DelayFrame(2);
+ // 鍒锋柊鎵�鏈塋ayout缁勪欢
+ foreach (var layout in layouts)
+ {
+ LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>());
+ }
+
+ }
+
+
}
--
Gitblit v1.8.0