From 0b72d489d989007a827c1f8ca33248441a6e85f9 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 02 八月 2025 23:06:46 +0800
Subject: [PATCH] 122 子 【武将】武将系统 / 【武将】武将系统-客户端 - 布阵
---
Main/System/Hero/HeroInfo.Fetter.cs | 45 ++
Main/Config/ConfigManager.cs | 3
Main/Component/UI/Effect/UIEffectPlayer.cs | 8
Main/System/HeroUI/HeroConnectionHeadCell.cs | 6
Main/System/Message/ColorAnalysis.cs | 105 +++---
Main/System/Hero/HeroInfo.Properties.cs | 12
Main/System/HeroUI/HeroScenePosCell.cs | 2
Main/System/Hero/HeroManager.cs | 34 +
Main/System/Main/HomeWin.cs | 11
Main/Config/PartialConfigs/PlayerPropertyConfig.cs | 14
Main/System/HeroUI/HeroFormationCell.cs | 71 ++++
Main/System/Team/TeamBase.cs | 10
Main/Core/ResModule/GameObjectPoolManager.cs | 64 ++++
Main/Component/UI/Common/GroupButtonEx.cs | 2
Main/Config/PartialConfigs/HeroFetterConfig.cs | 13
Main/Utility/EnumHelper.cs | 2
Main/System/Hero/UIHeroController.cs | 5
Main/System/HeroUI/HeroFormationCell.cs.meta | 2
Main/System/HeroUI/HeroFormationWin.cs.meta | 2
Main/Config/PartialConfigs/HeroLineupHaloConfig.cs | 10
Main/System/HeroUI/HeroFormationWin.cs | 70 ++++
Main/System/Hero/HeroInfo.cs | 1
/dev/null | 56 ---
Main/Utility/UIHelper.cs | 28 +
Main/System/HeroUI/HeroConnectionCell.cs | 22 +
Main/System/HeroUI/HeroPosWin.cs | 179 ++++++++++-
Main/Component/UI/Common/GroupButtonExManager.cs | 14
Main/System/HeroUI/HeroSelectBehaviour.cs | 22 +
Main/System/HeroUI/HeroUIManager.cs | 45 ++-
29 files changed, 645 insertions(+), 213 deletions(-)
diff --git a/Main/Component/UI/Common/GroupButtonEx.cs b/Main/Component/UI/Common/GroupButtonEx.cs
index 99fa338..4bb76fe 100644
--- a/Main/Component/UI/Common/GroupButtonEx.cs
+++ b/Main/Component/UI/Common/GroupButtonEx.cs
@@ -115,8 +115,6 @@
m_Manager.SelectButton(this);
}
- // 璁剧疆褰撳墠鎸夐挳涓洪�変腑鐘舵��
- state = TitleBtnState.Click;
}
// 鏇存柊鎸夐挳鐘舵��
diff --git a/Main/Component/UI/Common/GroupButtonExManager.cs b/Main/Component/UI/Common/GroupButtonExManager.cs
index bd88ecf..ab706eb 100644
--- a/Main/Component/UI/Common/GroupButtonExManager.cs
+++ b/Main/Component/UI/Common/GroupButtonExManager.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System;
+using Cysharp.Threading.Tasks;
/// <summary>
/// 鎸夐挳缁勭鐞嗗櫒锛岃礋璐g鐞咷roupButtonEx缁勪欢鐨勭粍鍏崇郴鍜岀姸鎬佸垏鎹�
@@ -31,6 +32,18 @@
set {
m_NormalTextColor = value;
}
+ }
+
+
+ void OnEnable()
+ {
+ ExecuteNextFrame();
+ }
+
+ protected async void ExecuteNextFrame()
+ {
+ await UniTask.DelayFrame(1);
+ UpdateAllButtonsState();
}
/// <summary>
@@ -70,6 +83,7 @@
if (button == null)
return;
+ button.state = TitleBtnState.Click;
// 鍙栨秷鍏朵粬鎸夐挳鐨勯�変腑鐘舵��
foreach (var btn in m_Buttons)
{
diff --git a/Main/Component/UI/Effect/UIEffectPlayer.cs b/Main/Component/UI/Effect/UIEffectPlayer.cs
index 3de63e7..03669ac 100644
--- a/Main/Component/UI/Effect/UIEffectPlayer.cs
+++ b/Main/Component/UI/Effect/UIEffectPlayer.cs
@@ -79,6 +79,11 @@
protected override void PlaySpineEffect()
{
+ if (spineComp == null)
+ {
+ spineComp = gameObject.AddMissingComponent<SkeletonGraphic>();
+ }
+
if (spineComp.skeletonDataAsset == null)
{
//LoadAsset 宸茬粡鏈夌紦瀛楽keletonDataAsset
@@ -86,6 +91,7 @@
spineComp.raycastTarget = false;
spineComp.Initialize(true);
spineAnimationState = spineComp.AnimationState;
+ spineAnimationState.Data.DefaultMix = 0f;
spineAnimationState.Complete -= OnSpineAnimationComplete;
spineAnimationState.Complete += OnSpineAnimationComplete;
}
@@ -103,7 +109,7 @@
if (skeletonData.Animations.Count > 0)
{
string defaultAnimationName = skeletonData.Animations.Items[0].Name;
- spineComp.AnimationState.SetAnimation(0, defaultAnimationName, isPlaySpineLoop);
+ spineAnimationState.SetAnimation(0, defaultAnimationName, isPlaySpineLoop);
}
else
{
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index f6e63cb..b98ef5a 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -85,7 +85,8 @@
typeof(TreasureItemLibConfig),
typeof(TreasureSetConfig),
typeof(TreeLVConfig),
- typeof(XBGetItemConfig)
+ typeof(XBGetItemConfig),
+ typeof(RichTextMsgReplaceConfig)
};
#if UNITY_EDITOR
diff --git a/Main/Config/PartialConfigs/HeroFetterConfig.cs b/Main/Config/PartialConfigs/HeroFetterConfig.cs
index 26b58b9..bc0a885 100644
--- a/Main/Config/PartialConfigs/HeroFetterConfig.cs
+++ b/Main/Config/PartialConfigs/HeroFetterConfig.cs
@@ -1,18 +1,19 @@
锘�
using System.Collections.Generic;
using System.IO;
-using System.Threading;
using System;
using UnityEngine;
using LitJson;
+using System.Linq;
+//缇佺粖锛氭灏�
public partial class HeroFetterConfig : ConfigBase<int, HeroFetterConfig>
{
private Dictionary<HeroAttrType, int> attrValues = new Dictionary<HeroAttrType, int>();
protected override void OnConfigParseCompleted()
- {
- base.OnConfigParseCompleted();
+ {
+ base.OnConfigParseCompleted();
// public int[] AttrIDList;
// public int[] AttrValueList;
@@ -34,7 +35,9 @@
attrValues.Add((HeroAttrType)AttrIDList[i], AttrValueList[i]);
}
- }
+
+
+ }
public int GetFetterAttr(HeroAttrType attrType)
{
@@ -45,4 +48,6 @@
return 0;
}
+
+
}
diff --git a/Main/Config/PartialConfigs/HeroLineupHaloConfig.cs b/Main/Config/PartialConfigs/HeroLineupHaloConfig.cs
index 832b17e..59d8155 100644
--- a/Main/Config/PartialConfigs/HeroLineupHaloConfig.cs
+++ b/Main/Config/PartialConfigs/HeroLineupHaloConfig.cs
@@ -4,7 +4,7 @@
public partial class HeroLineupHaloConfig : ConfigBase<int, HeroLineupHaloConfig>
{
// 鍥藉 鏁伴噺
- public static Dictionary<int, Dictionary<int, HeroLineupHaloConfig>> configDics = new Dictionary<int, Dictionary<int, HeroLineupHaloConfig>>();
+ private static Dictionary<int, Dictionary<int, HeroLineupHaloConfig>> configDics = new Dictionary<int, Dictionary<int, HeroLineupHaloConfig>>();
protected override void OnConfigParseCompleted()
{
@@ -32,4 +32,12 @@
return configDics[country][count];
}
+ public static Dictionary<int, HeroLineupHaloConfig> GetAttrsByCountry(int country)
+ {
+ Dictionary<int, HeroLineupHaloConfig> attrs;
+ configDics.TryGetValue(country, out attrs);
+
+ return attrs;
+ }
+
}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
index 179c143..4ea7bc6 100644
--- a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
+++ b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -76,7 +76,7 @@
return GetFullDescription(property.x, property.y);
}
- public static string GetFullDescription(int id, long value)
+ public static string GetFullDescription(int id, long value, string format="{0}+{1}")
{
var config = Get(id);
if (config == null)
@@ -86,18 +86,18 @@
if (config.ShowName.Contains("%s"))
{
- if (id == 52)
- {
- return Regex.Replace(config.ShowName, "%s", (value * 0.0001f).ToString("f2"));
- }
- else
+ // if (id == 52)
+ // {
+ // return Regex.Replace(config.ShowName, "%s", (value * 0.0001f).ToString("f2"));
+ // }
+ // else
{
return Regex.Replace(config.ShowName, "%s", value.ToString());
}
}
else
{
- return string.Format("{0} +{1}", config.ShowName, GetValueDescription(id, value));
+ return string.Format(format, config.ShowName, GetValueDescription(id, value));
}
}
diff --git a/Main/Core/ResModule/GameObjectPoolManager.cs b/Main/Core/ResModule/GameObjectPoolManager.cs
index 5214318..942a36e 100644
--- a/Main/Core/ResModule/GameObjectPoolManager.cs
+++ b/Main/Core/ResModule/GameObjectPoolManager.cs
@@ -2,6 +2,11 @@
using UnityEngine;
using System;
using Cysharp.Threading.Tasks;
+using System.Linq;
+
+#if UNITY_EDITOR
+using UnityEngine.Profiling;
+#endif
public class GameObjectPoolManager : SingletonMonobehaviour<GameObjectPoolManager>
@@ -10,6 +15,7 @@
private bool m_ShowDebugPanel = false;
private Vector2 m_ScrollPosition = Vector2.zero;
+
private void OnGUI()
{
if (!m_ShowDebugPanel) return;
@@ -19,6 +25,7 @@
m_ScrollPosition = GUILayout.BeginScrollView(m_ScrollPosition, GUILayout.Width(380), GUILayout.Height(580));
GUILayout.Label("瀵硅薄姹犺皟璇曢潰鏉�", GUILayout.Height(30));
+ LogPoolMemoryUsage();
GUILayout.Space(10);
foreach (var poolEntry in m_PoolDict)
@@ -49,6 +56,63 @@
Instance.m_ShowDebugPanel = !Instance.m_ShowDebugPanel;
}
}
+
+ public void LogPoolMemoryUsage()
+ {
+ long totalMemory = 0;
+ long totalFreeMemory = 0;
+ var prefabMemoryDict = new Dictionary<string, long>();
+
+ foreach (var poolEntry in m_PoolDict)
+ {
+ int prefabInstanceId = poolEntry.Key;
+ GameObjectPool pool = poolEntry.Value;
+ string prefabName = pool.Prefab.name;
+ long prefabMemory = 0;
+ long freeMemory = 0;
+
+ // 璁$畻娲昏穬瀵硅薄鐨勫唴瀛樺崰鐢�
+ foreach (var gameObject in pool.m_ActiveHashSet)
+ {
+ if (gameObject != null)
+ {
+ long memory = Profiler.GetRuntimeMemorySizeLong(gameObject);
+ prefabMemory += memory;
+ }
+ }
+
+ // 璁$畻绌洪棽瀵硅薄鐨勫唴瀛樺崰鐢�
+ foreach (var gameObject in pool.m_FreeQueue)
+ {
+ if (gameObject != null)
+ {
+ long memory = Profiler.GetRuntimeMemorySizeLong(gameObject);
+ prefabMemory += memory;
+ freeMemory += memory;
+ }
+ }
+
+ totalMemory += prefabMemory;
+ totalFreeMemory += freeMemory;
+ prefabMemoryDict[prefabName] = prefabMemory;
+ }
+
+ // 鎸夊唴瀛樺崰鐢ㄦ帓搴�
+ var sortedPrefabs = prefabMemoryDict.OrderByDescending(kv => kv.Value).Take(3).ToList();
+
+ GUILayout.Label($"鎬诲唴瀛樺崰鐢�: {totalMemory / 1024} KB", GUILayout.Height(30));
+ GUILayout.Label($"绌洪棽鍐呭瓨鍗犵敤: {totalFreeMemory / 1024} KB", GUILayout.Height(30));
+ GUILayout.Label("鍗犵敤鏈�楂樼殑鍓�3棰勫埗浣撳悕:", GUILayout.Height(30));
+ foreach (var prefabInstance in sortedPrefabs)
+ {
+ GUILayout.BeginHorizontal("Box");
+ GUILayout.Label($"{prefabInstance.Key}({prefabInstance.Value / 1024} KB)", GUILayout.Height(25));
+ GUILayout.EndHorizontal();
+ }
+
+ }
+
+
#endif
// 姹犵粺璁℃暟鎹�
public Dictionary<int, PoolStats> PoolStatistics { get; private set; } = new Dictionary<int, PoolStats>();
diff --git a/Main/System/Hero/HeroFetterInfo.cs b/Main/System/Hero/HeroFetterInfo.cs
deleted file mode 100644
index 2bab5c8..0000000
--- a/Main/System/Hero/HeroFetterInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-public class HeroFetterInfo
-{
- private HeroInfo heroInfo;
- private int fetterId;
-
- public HeroFetterConfig fetterConfig;
-
- protected bool isActive = false;
-
- public HeroFetterInfo(HeroInfo _heroInfo, int _fetterId)
- {
- heroInfo = _heroInfo;
- fetterId = _fetterId;
-
- fetterConfig = HeroFetterConfig.Get(fetterId);
- }
-
- // 鏄惁婵�娲讳簡缇佺粖
- public bool IsActiveFetter()
- {
- return isActive;
- }
-
- public void SetIsActiveFetter(TeamBase teamBase)
- {
- int fetterHeroCount = fetterConfig.HeroIDList.Length;
-
- int count = 0;
-
- for (int i = 0; i < teamBase.serverHeroes.Length; i++)
- {
- TeamHero teamHero = teamBase.serverHeroes[i];
-
- if (null == teamHero)
- continue;
-
- if (Array.IndexOf(fetterConfig.HeroIDList, teamHero.heroId) >= 0)
- {
- count++;
- }
- }
-
- isActive = (count >= fetterHeroCount);
- }
-
- public int GetFetterAttr(HeroAttrType attrType)
- {
- if (!isActive)
- return 0;
-
- return fetterConfig.GetFetterAttr(attrType);
- }
-}
\ No newline at end of file
diff --git a/Main/System/Hero/HeroInfo.Fetter.cs b/Main/System/Hero/HeroInfo.Fetter.cs
index b5e0f71..9175f06 100644
--- a/Main/System/Hero/HeroInfo.Fetter.cs
+++ b/Main/System/Hero/HeroInfo.Fetter.cs
@@ -1,21 +1,44 @@
+using System.Collections.Generic;
+using System.Linq;
+
public partial class HeroInfo
{
// 缇佺粖閰嶇疆
- public HeroFetterConfig fetterConfig;
+ public HeroFetterConfig fetterConfig;
- protected int GetIFByInheritFetterPercent(HeroAttrType attrType)
+
+ public List<int> GetActiveFetter(HeroConfig config, TeamBase teamBase)
{
- // YYL TODO
- int total = 0;
- for (int i = 0; i < fetterInfoList.Count; i++)
- {
- HeroFetterInfo fetterInfo = fetterInfoList[i];
- total += fetterInfo.GetFetterAttr(attrType);
- }
- return total;
- }
+ List<int> list = new List<int>();
+ if (config.FetterIDList.Length == 0)
+ return list;
+ foreach (var fetterID in config.FetterIDList)
+ {
+ HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID);
+ int count = 0;
+ for (int i = 0; i < teamBase.tempHeroes.Length; i++)
+ {
+ TeamHero teamHero = teamBase.tempHeroes[i];
+
+ if (null == teamHero)
+ continue;
+
+ if (fetterConfig.HeroIDList.Contains(teamHero.heroId))
+ {
+ count++;
+ }
+ if (count >= fetterConfig.HeroIDList.Length)
+ {
+ list.Add(fetterID);
+ break;
+ }
+ }
+ }
+
+ return list;
+ }
}
diff --git a/Main/System/Hero/HeroInfo.Properties.cs b/Main/System/Hero/HeroInfo.Properties.cs
index 0d25126..4b383dd 100644
--- a/Main/System/Hero/HeroInfo.Properties.cs
+++ b/Main/System/Hero/HeroInfo.Properties.cs
@@ -115,7 +115,7 @@
return GetStableProperties(attrType)
* GetCultivationPercent(attrType)
* GetInheritRate(attrType)
- * GetInfluenceByInheritPercent(attrType);
+ * GetTotalPercent(attrType);
}
@@ -139,15 +139,15 @@
}
// 琚户鎵挎瘮渚嬪奖鍝嶇殑鐧惧垎姣斿睘鎬�
- public int GetInfluenceByInheritPercent(HeroAttrType attrType)
+ public int GetTotalPercent(HeroAttrType attrType)
{
// 锛�1+缇佺粖鍔犳垚%+娼滆兘鍔犳垚%+澶╄祴鍔犳垚%+瑙夐啋鏁堟灉鍔犳垚%锛�
int IFByInheritPercent = 100;
- IFByInheritPercent += GetIFByInheritFetterPercent(attrType); //缇佺粖鍔犳垚 HeroInfo.Fetter
- IFByInheritPercent += GetIFByInheritBreakPercent(attrType); //娼滆兘鍔犳垚 HeroInfo.Break
- IFByInheritPercent += GetIFByInheritTalentPercent(attrType); //澶╄祴鍔犳垚 HeroInfo.Talent
- IFByInheritPercent += GetIFByInheritAwakePercent(attrType); //瑙夐啋鍔犳垚 HeroInfo.Awake
+ // IFByInheritPercent += GetIFByInheritFetterPercent(attrType); //缇佺粖鍔犳垚 HeroInfo.Fetter
+ // IFByInheritPercent += GetIFByInheritBreakPercent(attrType); //娼滆兘鍔犳垚 HeroInfo.Break
+ // IFByInheritPercent += GetIFByInheritTalentPercent(attrType); //澶╄祴鍔犳垚 HeroInfo.Talent
+ // IFByInheritPercent += GetIFByInheritAwakePercent(attrType); //瑙夐啋鍔犳垚 HeroInfo.Awake
return IFByInheritPercent;
}
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index a480fbf..d0cab14 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -41,7 +41,6 @@
- public List<HeroFetterInfo> fetterInfoList = new List<HeroFetterInfo>();
public List<HeroTalentInfo> talentList = new List<HeroTalentInfo>();
diff --git a/Main/System/Hero/HeroManager.cs b/Main/System/Hero/HeroManager.cs
index af90076..416dbc2 100644
--- a/Main/System/Hero/HeroManager.cs
+++ b/Main/System/Hero/HeroManager.cs
@@ -40,7 +40,7 @@
void OnBeforePlayerDataInitialize()
{
-
+
heroInfoDict.Clear();
}
@@ -73,7 +73,7 @@
heroInfoDict.TryGetValue(guid, out heroInfo);
heroInfoDict.Remove(guid);
-
+
if (null != heroInfo)
onHeroDeleteEvent?.Invoke(heroInfo);
}
@@ -95,12 +95,27 @@
{
if (job == 0 && country == 0)
return heroInfoDict.Keys.ToList();
-
- return heroInfoDict.Keys.Where((x) =>
+
+
+ List<string> retGuidList = new List<string>();
+ foreach (string guid in heroInfoDict.Keys)
{
- HeroInfo heroInfo = heroInfoDict[x];
- return heroInfo.heroConfig.Class == job && heroInfo.heroConfig.Country == country;
- }).ToList();
+ HeroInfo heroInfo = heroInfoDict[guid];
+ //0浠h〃鍏ㄩ儴
+ if (job == 0 || country == 0)
+ {
+ if (job != 0 && job == heroInfo.heroConfig.Class)
+ retGuidList.Add(guid);
+ if (country != 0 && country == heroInfo.heroConfig.Country)
+ retGuidList.Add(guid);
+ }
+ else
+ {
+ if (job == heroInfo.heroConfig.Class && country == heroInfo.heroConfig.Country)
+ retGuidList.Add(guid);
+ }
+ }
+ return retGuidList;
}
public List<HeroInfo> GetPowerfulHeroList()
@@ -131,7 +146,10 @@
}
-
+ public int GetHeroCount()
+ {
+ return heroInfoDict.Count;
+ }
}
\ No newline at end of file
diff --git a/Main/System/Hero/UIHeroController.cs b/Main/System/Hero/UIHeroController.cs
index c2291e3..20fd6af 100644
--- a/Main/System/Hero/UIHeroController.cs
+++ b/Main/System/Hero/UIHeroController.cs
@@ -48,6 +48,7 @@
skeletonGraphic.Initialize(true);
this.transform.localScale = Vector3.one * scale;
spineAnimationState = skeletonGraphic.AnimationState;
+ spineAnimationState.Data.DefaultMix = 0f;
PlayAnimation(MotionName.idle, true);
spineAnimationState.Complete -= OnAnimationComplete;
spineAnimationState.Complete += OnAnimationComplete;
@@ -73,8 +74,8 @@
{
if (spineAnimationState == null) return;
- // 鐩存帴浣跨敤 ToString() 鑰屼笉鏄皟鐢� GetAnimationName
- spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
+ // 鐩存帴浣跨敤 ToString() 鑰屼笉鏄皟鐢� GetAnimationName
+ spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
}
/// <summary>
diff --git a/Main/System/HeroUI/HeroConnectionCell.cs b/Main/System/HeroUI/HeroConnectionCell.cs
index 7cdeae4..f09ef80 100644
--- a/Main/System/HeroUI/HeroConnectionCell.cs
+++ b/Main/System/HeroUI/HeroConnectionCell.cs
@@ -7,9 +7,27 @@
[SerializeField] HeroConnectionHeadCell[] heros;
[SerializeField] Text connAttrText;
- public void Display()
+ public void Display(int fetterID)
{
-
+ HeroFetterConfig heroFetterConfig = HeroFetterConfig.Get(fetterID);
+ for (int i = 0; i < heros.Length; i++)
+ {
+ if (i < heroFetterConfig.HeroIDList.Length)
+ {
+ heros[i].SetActive(true);
+ heros[i].Display(heroFetterConfig.HeroIDList[i], i);
+ }
+ else
+ {
+ heros[i].SetActive(false);
+ }
+ }
+ string attrStr = "";
+ for (int i = 0; i < heroFetterConfig.AttrIDList.Length; i++)
+ {
+ attrStr += PlayerPropertyConfig.GetFullDescription(heroFetterConfig.AttrIDList[i], heroFetterConfig.AttrValueList[i]) + " ";
+ }
+ connAttrText.text = Language.Get("L1100", heroFetterConfig.FetterName, UIHelper.AppendColor(TextColType.lightYellow, attrStr));
}
}
diff --git a/Main/System/HeroUI/HeroConnectionHeadCell.cs b/Main/System/HeroUI/HeroConnectionHeadCell.cs
index 540cffc..0b13c49 100644
--- a/Main/System/HeroUI/HeroConnectionHeadCell.cs
+++ b/Main/System/HeroUI/HeroConnectionHeadCell.cs
@@ -9,6 +9,12 @@
[SerializeField] Text nameText;
[SerializeField] Image connMarkImg; //閾炬帴鐨勯攣鍥炬爣锛岀涓�涓笉鏄剧ず
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="heroID"></param>
+ /// <param name="index"> 鍙槸涓轰簡璁╃涓�涓笉鏄剧ず閿佸浘鏍囩敤</param>
+ /// <param name="guid">閮ㄥ垎鐣岄潰鏄剧ず涓嶅悓鐨偆鍥炬爣</param>
public void Display(int heroID, int index, string guid = "")
{
int skinID = 0;
diff --git a/Main/System/HeroUI/HeroFormationCell.cs b/Main/System/HeroUI/HeroFormationCell.cs
new file mode 100644
index 0000000..914eb12
--- /dev/null
+++ b/Main/System/HeroUI/HeroFormationCell.cs
@@ -0,0 +1,71 @@
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+//闃靛瀷
+public class HeroFormationCell : CellView
+{
+ [SerializeField] Image activeImg;
+ [SerializeField] Image countryOnImg; //涓婇樀闃靛瀷婵�娲诲浗瀹�
+ [SerializeField] Image[] OnCountImgs; //涓婇樀鏁伴噺婵�娲�
+ [SerializeField] RichText attrText;
+
+ public void Display(int index)
+ {
+ Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType);
+
+ var config = HeroLineupHaloConfig.GetConfig(result.x, result.y);
+ bool sameCountry = result.x == (index + 1);
+
+ activeImg.SetActive(config != null && sameCountry);
+
+
+ countryOnImg.SetSprite("heroTeamCountry" + (index + 1));
+ if (config == null || !sameCountry)
+ {
+ for (int i = 0; i < OnCountImgs.Length; i++)
+ {
+ OnCountImgs[i].SetActive(false);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < OnCountImgs.Length; i++)
+ {
+ if (i < result.y)
+ {
+ OnCountImgs[i].SetActive(true);
+ OnCountImgs[i].SetSprite("heroTeamCountryPoint" + result.x);
+ }
+ else
+ {
+ OnCountImgs[i].SetActive(false);
+ }
+ }
+ }
+
+
+ var attrDict = HeroLineupHaloConfig.GetAttrsByCountry(index + 1);
+ var countList = attrDict.Keys.ToList();
+ countList.Sort();
+ string text = string.Empty;
+ for (int k = 0; k < countList.Count; k++)
+ {
+ int count = countList[k];
+ string lineText = string.Empty;
+ bool isActive = sameCountry && count <= result.y;
+ string countStr = isActive ? UIHelper.AppendColor(TextColType.Green, count.ToString()) : count.ToString();
+ lineText = (k == 0 ? "" : "</r>") + Language.Get("herocard37", countStr, RichTextMsgReplaceConfig.GetRichReplace("Country", index + 1));
+ var attrConfig = attrDict[count];
+ for (int i = 0; i < attrConfig.AttrIDList.Length; i++)
+ {
+ string format = !isActive ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}");
+ lineText += " " + PlayerPropertyConfig.GetFullDescription(attrConfig.AttrIDList[i], attrConfig.AttrValueList[i], format);
+ }
+
+ text += UIHelper.AppendColor(isActive ? TextColType.NavyBrown : TextColType.Gray, lineText);
+ }
+ attrText.text = text;
+ }
+}
+
diff --git a/Main/System/Hero/HeroFetterInfo.cs.meta b/Main/System/HeroUI/HeroFormationCell.cs.meta
similarity index 83%
rename from Main/System/Hero/HeroFetterInfo.cs.meta
rename to Main/System/HeroUI/HeroFormationCell.cs.meta
index b759df1..37d6bc3 100644
--- a/Main/System/Hero/HeroFetterInfo.cs.meta
+++ b/Main/System/HeroUI/HeroFormationCell.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 61d40aba9c2091445ae692419d4c5ebf
+guid: bfc8cbe2e59ef934db88a564da0a7869
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/HeroUI/HeroFormationWin.cs b/Main/System/HeroUI/HeroFormationWin.cs
new file mode 100644
index 0000000..4c8e657
--- /dev/null
+++ b/Main/System/HeroUI/HeroFormationWin.cs
@@ -0,0 +1,70 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+/// <summary>
+/// 姝﹀皢闃靛瀷婵�娲荤晫闈�
+/// </summary>
+public class HeroFormationWin : UIBase
+{
+ [SerializeField] Button closeBtn;
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] Text totalAttrText;
+
+
+ protected override void InitComponent()
+ {
+ closeBtn.AddListener(CloseWindow);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ CreateScroller();
+
+ Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType);
+
+ var config = HeroLineupHaloConfig.GetConfig(result.x, result.y);
+ if (config == null)
+ {
+ totalAttrText.text = "";
+ }
+ else
+ {
+ string lineText = string.Empty;
+
+ for (int i = 0; i < config.AttrIDList.Length; i++)
+ {
+ string format = "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}");
+ lineText += " " + PlayerPropertyConfig.GetFullDescription(config.AttrIDList[i], config.AttrValueList[i], format);
+ }
+ totalAttrText.text = Language.Get("herocard36") + lineText.Trim();
+ }
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+
+
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroFormationCell;
+ _cell.Display(cell.index);
+ }
+
+ void CreateScroller()
+ {
+ scroller.Refresh();
+ for (int i = 0; i < 4; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/Hero/HeroFetterInfo.cs.meta b/Main/System/HeroUI/HeroFormationWin.cs.meta
similarity index 83%
copy from Main/System/Hero/HeroFetterInfo.cs.meta
copy to Main/System/HeroUI/HeroFormationWin.cs.meta
index b759df1..fff13af 100644
--- a/Main/System/Hero/HeroFetterInfo.cs.meta
+++ b/Main/System/HeroUI/HeroFormationWin.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 61d40aba9c2091445ae692419d4c5ebf
+guid: 93fbb2862890fb440bc497898f9935ef
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index 8656678..36f9e90 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -3,14 +3,19 @@
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
+using Cysharp.Threading.Tasks;
+using System.Threading;
+using System;
/// <summary>
-/// 姝﹀皢甯冮樀: 濡傛灉鍙互鍚屾椂鎵撳紑澶氫釜甯冮樀鐣岄潰 鍒欎娇鐢� functionOrder锛氬竷闃电被鍨�
+/// 姝﹀皢甯冮樀鐣岄潰
/// </summary>
public class HeroPosWin : UIBase
{
[SerializeField] Text[] attrOnList; //涓婇樀灞炴�у姞鎴�
+ [SerializeField] Button countryOnBtn;
[SerializeField] Image countryOnImg; //涓婇樀闃靛瀷婵�娲诲浗瀹�
+ [SerializeField] UIEffectPlayer countryEffect;
[SerializeField] List<Image> OnCountImgs; //涓婇樀鏁伴噺婵�娲�
[SerializeField] List<Image> scenePosImgs; //鍦烘櫙甯冮樀浣嶇疆
[SerializeField] HeroScenePosCell[] sceneHero;
@@ -22,7 +27,7 @@
[SerializeField] ScrollerController heroListScroller;
[SerializeField] Transform heroListEmpty;
[SerializeField] Toggle showConnTipToggleBtn;
- private bool isToggleOn = false;
+
[SerializeField] HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
[SerializeField] Button oneKeyOnBtn; //涓�閿笂闃�
@@ -38,43 +43,75 @@
[SerializeField] CanvasGroup flyAlphaTween;
Sequence sequence;
+ CancellationTokenSource _cts;
+ Queue<int> showConnectTipQueue = new Queue<int>();
+
+ private bool m_IsToggleOn = false;
+ private bool isToggleOn
+ {
+ get { return m_IsToggleOn; }
+ set
+ {
+ if (m_IsToggleOn != value)
+ {
+ m_IsToggleOn = value;
+ LocalSave.SetBool("ShowConn" + PlayerDatas.Instance.baseData.PlayerID, value);
+ }
+ }
+ }
protected override void InitComponent()
{
attackTeamBtn.AddListener(() =>
{
- if (HeroUIManager.Instance.selectTeamType == TeamType.Arena)
- {
- return;
- }
-
- HeroUIManager.Instance.selectTeamType = (TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(0);
- Refresh();
+ SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(0));
});
defendTeamBtn.AddListener(() =>
{
- if (HeroUIManager.Instance.selectTeamType == TeamType.ArenaDefense)
- {
- return;
- }
- HeroUIManager.Instance.selectTeamType = (TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(1);
- Refresh();
+ SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(1));
+ });
+
+ mainFBBtn.AddListener(() =>
+ {
+ SelectTeamFunc(TeamType.Story);
+ });
+
+ jjcBtn.AddListener(() =>
+ {
+ SelectTeamFunc(TeamType.Arena);
+ });
+ tttBtn.AddListener(() =>
+ {
+ SelectTeamFunc(TeamType.Tower);
});
showConnTipToggleBtn.AddListener((value) =>
{
isToggleOn = showConnTipToggleBtn.isOn;
+ if (isToggleOn == false)
+ {
+ CancelCurrentTask();
+ }
});
oneKeyOnBtn.AddListener(OneKeyOnPos);
saveBtn.AddListener(SaveTeam);
backBtn.AddListener(CloseWindow);
+
+ countryOnBtn.AddListener(() =>
+ {
+ UIManager.Instance.OpenWindow<HeroFormationWin>();
+ });
+
+ m_IsToggleOn = LocalSave.GetBool("ShowConn" + PlayerDatas.Instance.baseData.PlayerID, false);
}
protected override void OnPreOpen()
{
- HeroUIManager.Instance.SortHeroOnTeamList(); //鎵撳紑鐣岄潰鍜屼繚瀛橈紙鏈嶅姟绔級鏇存柊闃靛鏄埛鏂�
+ HeroUIManager.Instance.selectTeamPosJob = 0;
+ HeroUIManager.Instance.selectTeamPosCountry = 0;
+ HeroUIManager.Instance.SortHeroOnTeamList();
heroListScroller.OnRefreshCell += OnRefreshCell;
HeroUIManager.Instance.OnTeamPosChangeEvent += TeamChangeEvent;
CreateScroller();
@@ -83,7 +120,10 @@
protected override void OnPreClose()
{
+ CancelCurrentTask();
heroListScroller.OnRefreshCell -= OnRefreshCell;
+ HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamChangeEvent;
+ TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType).RestoreTeam();
}
@@ -94,8 +134,9 @@
RefreshOnTeamBtn();
RefreshTeamHero();
RefreshFlyHead();
+ RefreshConn();
- if (HeroUIManager.Instance.heroOnTeamSortList.Count == 0)
+ if (HeroManager.Instance.GetHeroCount() == 0)
{
heroListEmpty.SetActive(true);
heroListScroller.SetActive(false);
@@ -108,10 +149,12 @@
showConnTipToggleBtn.isOn = isToggleOn;
- fiterManager.Display(0, 0, 0, SelectJobCountry);
+ fiterManager.Display(0, HeroUIManager.Instance.selectTeamPosJob, HeroUIManager.Instance.selectTeamPosCountry, SelectJobCountry);
fightPowerText.text = "1234k";
+
+
}
void RefreshFlyHead()
@@ -123,11 +166,21 @@
flyHead.transform.localScale = Vector3.zero;
}
+ void RefreshConn()
+ {
+ connetionForm.SetActive(false);
+ var canvasConn = connetionForm.GetComponent<Canvas>();
+ canvasConn.sortingLayerID = canvas.sortingLayerID;
+ canvasConn.sortingOrder = canvas.sortingOrder + 9;
+ CancelCurrentTask();
+ }
+
void SelectJobCountry(int job, int country)
{
HeroUIManager.Instance.selectTeamPosJob = job;
HeroUIManager.Instance.selectTeamPosCountry = country;
HeroUIManager.Instance.SortHeroOnTeamList();
+ CreateScroller();
}
void OnRefreshCell(ScrollerDataType type, CellView cell)
@@ -176,14 +229,14 @@
}
//涓婇樀姝﹀皢鍥藉鍏夌幆婵�娲�
- void RefreshOnTeamCountry()
+ void RefreshOnTeamCountry(bool playEffect = false)
{
Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType);
var config = HeroLineupHaloConfig.GetConfig(result.x, result.y);
if (config == null)
{
- countryOnImg.SetSprite("heroTeamCountry" + result.x);
+ countryOnImg.SetSprite("heroTeamCountry0");
for (int i = 0; i < OnCountImgs.Count; i++)
{
OnCountImgs[i].SetActive(false);
@@ -204,8 +257,9 @@
OnCountImgs[i].SetActive(false);
}
}
+ if (playEffect)
+ countryEffect.Play();
}
-
}
@@ -258,7 +312,7 @@
}
void RefreshPosScale()
- {
+ {
for (int i = 0; i < scenePosImgs.Count; i++)
{
scenePosImgs[i].transform.localScale = Vector3.one;
@@ -292,6 +346,7 @@
}
RefreshPosScale();
heroListScroller.m_Scorller.RefreshActiveCellViews();
+ RefreshOnTeamCountry(true);
//琛ㄧ幇椋炲叆锛岃繛缁偣鍑讳笉鍚屽ご鍍忚Е鍙戠殑璇濆垯閲嶇疆
if (flyFrom > -1)
@@ -317,7 +372,72 @@
.Join(flyHead.transform.DOScale(new Vector3(0.5f, 0.5f, 0.5f), HeroUIManager.clickFlyPosTime).SetEase(Ease.OutQuad))
.Join(flyAlphaTween.DOFade(0f, HeroUIManager.clickFlyPosTime).SetEase(Ease.OutQuad));
sequence.onComplete = () => { flyHead.transform.localScale = Vector3.zero; };
+
+ if (isToggleOn)
+ {
+ ShowFetter(flyHero);
+ }
}
+ }
+
+ void ShowFetter(HeroInfo hero)
+ {
+ var heroConfig = hero.heroConfig;
+ var fetterList = hero.GetActiveFetter(heroConfig, TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType));
+ for (int i = 0; i < fetterList.Count; i++)
+ {
+ if(!showConnectTipQueue.Contains(fetterList[i]))
+ showConnectTipQueue.Enqueue(fetterList[i]);
+ }
+
+ if (_cts == null)
+ {
+ _cts = new CancellationTokenSource();
+ RunTaskAsync(_cts.Token).Forget(); // Forget() 琛ㄧず涓嶇瓑寰呮浠诲姟瀹屾垚
+ }
+
+ }
+ async UniTask RunTaskAsync(CancellationToken token)
+ {
+ try
+ {
+ while (showConnectTipQueue.Count > 0)
+ {
+ await UniTask.Delay(300, cancellationToken: token);
+ showConnectTipQueue.TryDequeue(out int fetterID);
+ if (fetterID == 0)
+ {
+ continue;
+ }
+ connetionForm.SetActive(true);
+ connetionForm.Display(fetterID);
+ //鏄剧ず1.5绉掑悗鍏抽棴
+ await UniTask.Delay(1500, cancellationToken: token);
+ connetionForm.SetActive(false);
+ }
+
+ }
+ catch (OperationCanceledException)
+ {
+ Debug.Log("缇佺粖 鍗忕▼琚彇娑�");
+ connetionForm.SetActive(false);
+ }
+ finally
+ {
+ _cts?.Dispose(); // 閲婃斁璧勬簮
+ _cts = null; // 缃┖閬垮厤閲嶅鍙栨秷
+ showConnectTipQueue.Clear();
+ }
+
+ }
+
+ // 鍙栨秷褰撳墠姝e湪杩愯鐨勪换鍔�
+ public void CancelCurrentTask()
+ {
+ _cts?.Cancel(); // 瑙﹀彂鍙栨秷
+ _cts?.Dispose(); // 閲婃斁璧勬簮
+ _cts = null; // 缃┖閬垮厤閲嶅鍙栨秷
+ showConnectTipQueue.Clear();
}
void OneKeyOnPos()
@@ -339,4 +459,19 @@
var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
team.SaveTeam();
}
+
+ void SelectTeamFunc(TeamType type)
+ {
+ if (HeroUIManager.Instance.selectTeamType == type)
+ {
+ return;
+ }
+
+ HeroUIManager.Instance.selectTeamPosJob = 0;
+ HeroUIManager.Instance.selectTeamPosCountry = 0;
+ HeroUIManager.Instance.SortHeroOnTeamList();
+ HeroUIManager.Instance.selectTeamType = type;
+ Refresh();
+ heroListScroller.m_Scorller.RefreshActiveCellViews();
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroScenePosCell.cs b/Main/System/HeroUI/HeroScenePosCell.cs
index 9846fdc..a8351d2 100644
--- a/Main/System/HeroUI/HeroScenePosCell.cs
+++ b/Main/System/HeroUI/HeroScenePosCell.cs
@@ -39,7 +39,7 @@
heroConfig.AtkDistType == 2 && TeamConst.TeamPos1Array.Contains(index))
{
suggestForm.SetActive(true);
- jobTip.text = Language.Get("heroClass" + heroConfig.Class);
+ jobTip.text = RichTextMsgReplaceConfig.GetRichReplace("Class", heroConfig.Class);
posTip.text = Language.Get("heroAtkDistType" + heroConfig.AtkDistType);
}
else
diff --git a/Main/System/HeroUI/HeroSelectBehaviour.cs b/Main/System/HeroUI/HeroSelectBehaviour.cs
index 2430711..0385c40 100644
--- a/Main/System/HeroUI/HeroSelectBehaviour.cs
+++ b/Main/System/HeroUI/HeroSelectBehaviour.cs
@@ -12,16 +12,16 @@
[SerializeField] Button unFoldBtn; //灞曞紑鎸夐挳
[SerializeField] GroupButtonEx[] jobsBtn;
[SerializeField] GroupButtonEx[] countrysBtn;
- [SerializeField] GroupButtonExManager jobManager;
- [SerializeField] GroupButtonExManager countryManager;
+ [SerializeField] GroupButtonExManager jobManager;
+ [SerializeField] GroupButtonExManager countryManager;
int m_Job = 0;
int m_Country = 0;
int foldState = 0; //0 鏀惰捣锛�1 灞曞紑
//鐐瑰嚮鎸夐挳闇�閫氱煡鍝嶅簲澶栭儴浜嬩欢
- public Action<int, int> selectAction;
-
+ private Action<int, int> selectAction;
+
@@ -92,5 +92,19 @@
unFoldForm.SetActive(foldState == 1);
foldForm.SetActive(foldState == 0);
}
+
+
+ private void LateUpdate()
+ {
+ if (foldState == 0)
+ return;
+ if (Input.GetMouseButtonDown(0))
+ {
+ if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, Input.mousePosition, CameraManager.uiCamera))
+ {
+ foldBtn.onClick.Invoke();
+ }
+ }
+ }
}
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 1efeaae..6890863 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -93,7 +93,24 @@
#region 甯冮樀鐣岄潰
public List<string> heroOnTeamSortList { get; private set; } = new List<string>(); //涓嶅悓涓婇樀鐨勫垪琛ㄦ帓搴�
- public TeamType selectTeamType = TeamType.Story; //褰撳墠閫変腑鐨勬槸鍝釜闃靛, 甯冮樀鐩稿叧閫昏緫浣跨敤
+ private TeamType m_SelectTeamType = TeamType.Story; //褰撳墠閫変腑鐨勬槸鍝釜闃靛, 甯冮樀鐩稿叧閫昏緫浣跨敤
+ public TeamType selectTeamType
+ {
+ get { return m_SelectTeamType; }
+ set
+ {
+ if (m_SelectTeamType == value)
+ return;
+ //涓婁竴涓樀瀹归渶瑕佹仮澶嶅埌鍘熺姸鎬�
+ if (m_SelectTeamType != TeamType.None)
+ {
+ TeamManager.Instance.GetTeam(m_SelectTeamType).RestoreTeam();
+ }
+
+ m_SelectTeamType = value;
+ }
+ }
+
public int selectTeamPosJob = 0; //甯冮樀鐣岄潰 绛涢�夎亴涓�
public int selectTeamPosCountry = 0; //甯冮樀鐣岄潰 绛涢�夊浗瀹�
@@ -160,23 +177,21 @@
var team = TeamManager.Instance.GetTeam(teamType);
if (team != null)
{
- for (int i = 0; i < team.serverHeroes.Length; i++)
+ for (int i = 0; i < team.tempHeroes.Length; i++)
{
- if (team.serverHeroes[i] == null)
+ if (team.tempHeroes[i] == null)
continue;
- var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid);
- if (hero != null)
- {
- if (!heroCountryCount.ContainsKey(hero.heroCountry))
- {
- heroCountryCount.Add(hero.heroCountry, 1);
- }
- else
- {
- heroCountryCount[hero.heroCountry] += 1;
- }
+ var country = (HeroCountry)team.tempHeroes[i].heroConfig.Country;
+ if (!heroCountryCount.ContainsKey(country))
+ {
+ heroCountryCount.Add(country, 1);
}
+ else
+ {
+ heroCountryCount[country] = heroCountryCount[country] + 1;
+ }
+
}
}
@@ -226,7 +241,7 @@
//鎺ㄨ崘闃靛鐨勭畻娉曢�昏緫
//鑷姩閫夋嫨浼樺厛绾э細姝﹀皢绛夌骇锛炵獊鐮寸瓑绾э紴姝﹀皢瑙夐啋闃剁骇锛炴灏嗗搧璐紴姝﹀皢鍚炲櫖鏄熺骇锛炴灏咺D
var tmpList = HeroManager.Instance.GetHeroGuidList();
- tmpList.Sort(CmpHeroByTeamType);
+ tmpList.Sort(CmpHeroRecommend);
//鎺ㄨ崘鏈�澶�6涓紝瀛樺湪鐩稿悓heroid锛屽垯璺宠繃
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 3b77d73..168cd28 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -25,6 +25,8 @@
//鍏冲崱
[SerializeField] Button bossBtn;
+ [SerializeField] Button changeHeroPosBtn;
+
/// <summary>
/// 鍒濆鍖栫粍浠�
/// </summary>
@@ -34,6 +36,12 @@
bossBtn.AddListener(() =>
{
UIManager.Instance.OpenWindow<MainBossEnterWin>();
+ });
+
+ changeHeroPosBtn.AddListener(() =>
+ {
+ HeroUIManager.Instance.selectTeamType = TeamType.Story;
+ UIManager.Instance.OpenWindow<HeroPosWin>();
});
}
@@ -52,9 +60,6 @@
TaskManager.Instance.OnTaskUpdate += UpdateTask;
Refresh();
UIManager.Instance.OpenWindow<BattleWin>();
-
- taskEffect.effectId = Random.Range(1007, 1008);
- taskEffect.Play();
}
protected override void OnOpen()
{
diff --git a/Main/System/Message/ColorAnalysis.cs b/Main/System/Message/ColorAnalysis.cs
index a719dc8..5cda495 100644
--- a/Main/System/Message/ColorAnalysis.cs
+++ b/Main/System/Message/ColorAnalysis.cs
@@ -9,25 +9,26 @@
public override string Analysis(string val, bool IsRich)
{
- if (!Color_Start_Regex.IsMatch(val) || RichTextMgr.Inst.presentRichText == null)
- {
- return val;
- }
- int index = 0;
- m_StringBuilder.Length = 0;
- var _text = RichTextMgr.Inst.presentRichText;
- if (_text.colorType == RichText.ColorType.Bright)
- {
- return val;
- }
- foreach (Match match in Color_Start_Regex.Matches(val))
- {
- m_StringBuilder.Append(val.Substring(index, match.Groups[1].Index - index));
- m_StringBuilder.Append(GetColorMap(match.Groups[1].Value));
- index = match.Groups[1].Index + match.Groups[1].Length;
- }
- m_StringBuilder.Append(val.Substring(index, val.Length - index));
- return m_StringBuilder.ToString();
+ return val;
+ // if (!Color_Start_Regex.IsMatch(val) || RichTextMgr.Inst.presentRichText == null)
+ // {
+ // return val;
+ // }
+ // int index = 0;
+ // m_StringBuilder.Length = 0;
+ // var _text = RichTextMgr.Inst.presentRichText;
+ // if (_text.colorType == RichText.ColorType.Bright)
+ // {
+ // return val;
+ // }
+ // foreach (Match match in Color_Start_Regex.Matches(val))
+ // {
+ // m_StringBuilder.Append(val.Substring(index, match.Groups[1].Index - index));
+ // m_StringBuilder.Append(GetColorMap(match.Groups[1].Value));
+ // index = match.Groups[1].Index + match.Groups[1].Length;
+ // }
+ // m_StringBuilder.Append(val.Substring(index, val.Length - index));
+ // return m_StringBuilder.ToString();
}
private string GetColorMap(string _value)
@@ -36,39 +37,39 @@
{
_value = _value.Substring(0, 6);
}
- switch (_value.ToLower())
- {
- case "109d06":
- return "35e122";
- case "ff6701":
- return "f8983b";
- case "006be3":
- return "31cefb";
- case "ff0303":
- return "fa0101";
- case "12a199":
- return "13a199";
- case "686868":
- return "f7f7f7";
- case "da48d5":
- return "ec4bf6";
- case "f6408d":
- return "ff7c7c";
- case "bb8800":
- return "ffde00";
- case "666666":
- return "dddddd";
- case "9460ff":
- return "7999ff";
- case "0066ff":
- return "00c6ff";
- case "00b337":
- return "66ff00";
- case "ff6600":
- return "ff9000";
- case "ff00f6":
- return "f000ff";
- }
+ // switch (_value.ToLower())
+ // {
+ // case "109d06":
+ // return "35e122";
+ // case "ff6701":
+ // return "f8983b";
+ // case "006be3":
+ // return "31cefb";
+ // case "ff0303":
+ // return "fa0101";
+ // case "12a199":
+ // return "13a199";
+ // case "686868":
+ // return "f7f7f7";
+ // case "da48d5":
+ // return "ec4bf6";
+ // case "f6408d":
+ // return "ff7c7c";
+ // case "bb8800":
+ // return "ffde00";
+ // case "666666":
+ // return "dddddd";
+ // case "9460ff":
+ // return "7999ff";
+ // case "0066ff":
+ // return "00c6ff";
+ // case "00b337":
+ // return "66ff00";
+ // case "ff6600":
+ // return "ff9000";
+ // case "ff00f6":
+ // return "f000ff";
+ // }
return _value;
}
diff --git a/Main/System/Team/TeamBase.cs b/Main/System/Team/TeamBase.cs
index 14622c7..f578df0 100644
--- a/Main/System/Team/TeamBase.cs
+++ b/Main/System/Team/TeamBase.cs
@@ -252,6 +252,16 @@
tempHeroes[posNum] = hero;
}
+ // 甯冮樀鎺ュ彛: 鎭㈠闃靛
+ public void RestoreTeam()
+ {
+ for (int i = 0; i < tempHeroes.Length; i++)
+ {
+ tempHeroes[i] = serverHeroes[i];
+ }
+ }
+
+
public void AddHero(HeroInfo heroInfo, int targetPosition)
{
if (targetPosition < 0 || targetPosition >= tempHeroes.Length)
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index a597a7f..3c46f91 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -1084,7 +1084,7 @@
White = 1,
titleSelectColor = 2,
titleUnSelectColor = 3,
-
+ lightYellow = 4, //娴呴粍鑹�
Red = 5,
Pink = 6,
/// <summary>
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index b3bdcd3..e5e468a 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -515,10 +515,10 @@
public static readonly Color s_NavyBrown = new Color32(110, 76, 49, 255);//6e4c31
public static readonly Color s_Black = new Color32(0, 0, 0, 255);
- public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255);
+ 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(187, 187, 187, 255); //bbbbbb
+ public static readonly Color s_Gray = new Color32(132, 121, 123, 255); //84797b
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
@@ -645,9 +645,9 @@
case TextColType.White:
return bright ? s_BrightWhiteColor : s_DarkWhiteColor; // s_BrightWhiteColor 鏄寒搴曠伆鑹�
case TextColType.titleSelectColor:
- return new Color32(114, 157, 228, 255);
- case TextColType.titleUnSelectColor:
return new Color32(127, 65, 57, 255);
+ case TextColType.titleUnSelectColor:
+ return new Color32(110, 92, 96, 255);
case TextColType.Red:
return bright ? s_BrightRedColor : s_DarkRedColor;
case TextColType.Pink:
@@ -660,6 +660,8 @@
return s_BrightGreenColor;
case TextColType.Black:
return s_Black;
+ case TextColType.lightYellow: //娴呴粍鑹�
+ return new Color32(252, 237, 185, 255);
case TextColType.NavyYellow:
return s_NavyYellow;
case TextColType.LightGreen:
@@ -771,12 +773,12 @@
public static string AppendColor(TextColType type, string msg, bool bright = false)
{
- if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#")
- && msg.ToLower().EndsWith("</color>"))
- {
- Match match = m_TextColorRegex.Match(msg);
- msg = match.Groups[1].Value;
- }
+ // if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#")
+ // && msg.ToLower().EndsWith("</color>"))
+ // {
+ // Match match = m_TextColorRegex.Match(msg);
+ // msg = match.Groups[1].Value;
+ // }
switch (type)
{
case TextColType.None:
@@ -803,7 +805,11 @@
case TextColType.LightGreen:
return StringUtility.Contact("<color=#", "8ddc11", ">", msg, "</color>");
case TextColType.Gray:
- return StringUtility.Contact("<color=#", "686868", ">", msg, "</color>");
+ return StringUtility.Contact("<color=#", "84797b", ">", msg, "</color>");
+ case TextColType.lightYellow:
+ return StringUtility.Contact("<color=#", "fcedb9", ">", msg, "</color>");
+ case TextColType.NavyYellow:
+ return StringUtility.Contact("<color=#", "f2ee02", ">", msg, "</color>");
}
return msg;
}
--
Gitblit v1.8.0