From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version

---
 Main/System/HeroUI/HeroTrainWin.cs |   71 +++++++++++++++++++++--------------
 1 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index e0b5aaf..f08d797 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -104,11 +104,9 @@
     // 鍖哄垎绐佺牬鍜屽煿鍏绘ā鍧�
     [SerializeField] HeroLVBreakCell heroLVBreakCell;   //瀵瑰簲鍩瑰吇鐨� allAttrScroll  鍜� attrBtn
 
-    [SerializeField] GroupButtonEx trainMainButton; //鍩瑰吇鍏ュ彛鎸夐挳
-    [SerializeField] GroupButtonEx breakMainButton; //绐佺牬鍏ュ彛鎸夐挳
-    //鍏ュ彛浼孩鐐圭敤鍥剧墖浠f浛
-    [SerializeField] Image trainMainRedImg;
-    [SerializeField] Image breakMainRedImg;
+
+    bool isTrainMainRed;
+    bool isBreakMainRed;
     #endregion
 
 
@@ -124,10 +122,12 @@
         showFuncBtn.AddListener(() =>
         {
             funcForm.SetActive(true);
+            UIManager.Instance.GetUI<HeroTrainBaseWin>().GetCanvasGroup().alpha = 1;
         });
         seeLhBtn.AddListener(() =>
         {
             funcForm.SetActive(false);
+            UIManager.Instance.GetUI<HeroTrainBaseWin>().GetCanvasGroup().alpha = 0;
         });
         closeBtn.AddListener(CloseWindow);
         rightBtn.AddListener(() =>
@@ -205,25 +205,13 @@
             freezeTipGo.SetActive(!freezeTipGo.activeSelf);
         });
 
-        trainMainButton.AddListener(() =>
-        {
-            functionOrder = 0;
-            DisplayTrainOrBreak(hero);
-            ForceRefreshLayout();
-        });
-
-        breakMainButton.AddListener(() =>
-        {
-            functionOrder = 1;
-            DisplayTrainOrBreak(hero);
-            unfoldState = false;
-            RefreshFoldState();
-        });
     }
 
 
     protected override void OnPreOpen()
     {
+   
+
         PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
         HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
         UIManager.Instance.OnCloseWindow += OnCloseWindow;
@@ -232,10 +220,25 @@
 
         guid = HeroUIManager.Instance.selectHeroGuid;
         hero = HeroManager.Instance.GetHero(guid);
+
+        if (functionOrder == 0)
+        {
+            DisplayTrainOrBreak(hero);
+            ForceRefreshLayout();
+        }
+        else if (functionOrder == 1)
+        {
+            DisplayTrainOrBreak(hero);
+            unfoldState = false;
+            RefreshFoldState();
+        }
+
+
         unfoldState = false;
         addPerObject.SetActive(false);
         allAttrScroll.verticalNormalizedPosition = 1;
         Display();
+        HeroUIManager.Instance.PlayerLHSound(hero.SkinID);
     }
 
 
@@ -263,8 +266,9 @@
 
     public void Display()
     {
-        bgTexture.SetTexture2D("countryBG" + hero.heroConfig.Country);
+        bgTexture.SetTexture2D(HeroUIManager.Instance.GetBGName(hero.SkinID, hero.heroConfig.Country));
         roleLhModel.Create(hero.SkinID, 1, motionName: "", isLh: true);
+        
         roleXsModel.Create(hero.SkinID, 1);
         jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
         jobPosNameText.text = HeroUIManager.Instance.GetJobName(hero.heroConfig.Class);
@@ -295,6 +299,8 @@
         RefreshAwake();
         RefreshFreeze();
         RefreshRedImg();
+        HeroUIManager.Instance.UpdateTheHeroCardRedpoint(isTrainMainRed, isBreakMainRed,
+            HeroUIManager.Instance.HeroAllSkinStateForRedpoint(hero.heroId) > 0);
         DisplayTrainOrBreak(hero);
         ShowDeleteTip();
 
@@ -393,9 +399,18 @@
         {
             resultIndex = 0;
         }
-        guid = HeroUIManager.Instance.heroSortList[resultIndex];
+        guid = HeroUIManager.Instance.selectHeroGuid = HeroUIManager.Instance.heroSortList[resultIndex];
         hero = HeroManager.Instance.GetHero(guid);
         Display();
+
+        HeroUIManager.Instance.PlayerLHSound(hero.SkinID);
+
+        //鎺у埗涓�绾у姛鑳界晫闈㈢殑鐨偆鎸夐挳
+        var ui = UIManager.Instance.GetUI<HeroTrainBaseWin>();
+        if (ui != null)
+        {
+            ui.ShowSkinBtn();
+        }
     }
 
 
@@ -877,8 +892,8 @@
         redpointAwake.SetActive(false);
         redpointGift.SetActive(false);
         redpointLVUP.SetActive(false);
-        trainMainRedImg.SetActive(false);
-        breakMainRedImg.SetActive(false);
+        isTrainMainRed = false;
+        isBreakMainRed = false;
         redpointBreakLVUP.SetActive(false);
 
 
@@ -889,7 +904,7 @@
         if (heroCnt > 1 && hero.heroStar < hero.GetCurMaxStar())
         {
             redpointGift.SetActive(true);
-            trainMainRedImg.SetActive(true);
+            isTrainMainRed = true;
         }
 
 
@@ -900,7 +915,7 @@
             if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1])
             {
                 redpointLVUP.SetActive(true);
-                trainMainRedImg.SetActive(true);
+                isTrainMainRed = true;
             }
         }
 
@@ -922,7 +937,7 @@
                 if (itemPack.GetCountById(config.UPCostItem[0]) >= config.UPCostItem[1])
                 {
                     redpointAwake.SetActive(true);
-                    trainMainRedImg.SetActive(true);
+                    isTrainMainRed = true;
                 }
             }
         }
@@ -930,7 +945,7 @@
         if (HeroUIManager.Instance.IsCanBreak(hero))
         {
             redpointBreakLVUP.SetActive(true);
-            breakMainRedImg.SetActive(true);
+            isBreakMainRed = true;
         }
 
     }
@@ -945,7 +960,6 @@
             heroLVBreakCell.SetActive(false);
             allAttrScroll.SetActive(true);
             attrBtn.SetActive(true);
-            trainMainButton.SelectBtn();
         }
         else
         {
@@ -954,7 +968,6 @@
             attrBtn.SetActive(false);
 
             heroLVBreakCell.Display(hero);
-            breakMainButton.SelectBtn();
         }
     }
 

--
Gitblit v1.8.0