From 51f023b1ef1842dffc7a17e8da3286f46d067199 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 08 九月 2025 14:54:29 +0800
Subject: [PATCH] 117 【武将】武将系统 - 潜能 觉醒总览描述

---
 Main/System/HeroUI/HeroAwakeWin.cs            |    4 +
 Main/System/HeroUI/HeroAwakePrivewWin.cs.meta |   11 ++
 Main/System/HeroUI/HeroAwakePrivewWin.cs      |   88 ++++++++++++++++++++++
 Main/System/HeroUI/HeroTrainWin.cs            |  123 ++++++++++++++++++++++++++----
 4 files changed, 207 insertions(+), 19 deletions(-)

diff --git a/Main/System/HeroUI/HeroAwakePrivewWin.cs b/Main/System/HeroUI/HeroAwakePrivewWin.cs
new file mode 100644
index 0000000..7743ae2
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakePrivewWin.cs
@@ -0,0 +1,88 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢瑙夐啋鎬昏鐣岄潰
+/// </summary>
+public class HeroAwakePrivewWin : UIBase
+{
+    [SerializeField] ScrollRect scrollRect;
+    [SerializeField] GameObject descCell; //鐢ㄤ簬鍒涘缓
+    [SerializeField] Transform awakeCellParent; //娼滆兘鐖惰妭鐐�
+    List<GameObject> awakeCellList;   //瑙夐啋
+
+    protected override void InitComponent()
+    {
+        awakeCellList = new List<GameObject>();
+    }
+
+    protected override void OnPreOpen()
+    {
+        scrollRect.verticalNormalizedPosition = 1;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+    }
+
+
+    public void Display()
+    {
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
+        if (hero == null)
+            return;
+
+        descCell.SetActive(false);
+        var maxLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId);
+        var starCnt = HeroQualityConfig.Get(hero.Quality).InitStarUpper;
+        for (int i = 1; i <= maxLV; i++)
+        {
+            if (i > awakeCellList.Count)
+            {
+                awakeCellList.Add(Instantiate(descCell, awakeCellParent));
+            }
+            var go = awakeCellList[i - 1];
+            var descText = go.GetComponent<Text>();
+            var nameText = go.GetComponent<Text>("skillname");
+            go.SetActive(true);
+
+            var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, i);
+
+            int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
+            var awakeStr = string.Empty;
+            if (type == 1)
+            {
+                starCnt += config.AddStarUpper;
+                awakeStr = Language.Get("HeroAwake8", config.UnlockTalentSlot, starCnt);
+            }
+            else if (type == 2)
+            {
+                awakeStr = SkillConfig.Get(config.SkillID).Description;
+            }
+            else
+            {
+                for (int k = 0; k < config.AttrIDList.Length; k++)
+                {
+                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k]) +
+                        (k == config.AttrIDList.Length - 1 ? "" : "\n");
+                }
+            }
+
+            if (i - 1 < hero.awakeLevel)
+            {
+                nameText.text = Language.Get("herocard12", i) + Language.Get("L1096");
+                descText.text = awakeStr;
+            }
+            else
+            {
+                //缃伆
+                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096"));
+                descText.text = UIHelper.AppendColor(TextColType.NavyGray, awakeStr);
+            }
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAwakePrivewWin.cs.meta b/Main/System/HeroUI/HeroAwakePrivewWin.cs.meta
new file mode 100644
index 0000000..3c0fc13
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakePrivewWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 39388fec8991cad4ca7412dba0ec9860
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/HeroUI/HeroAwakeWin.cs b/Main/System/HeroUI/HeroAwakeWin.cs
index e95d23a..25ac258 100644
--- a/Main/System/HeroUI/HeroAwakeWin.cs
+++ b/Main/System/HeroUI/HeroAwakeWin.cs
@@ -21,6 +21,10 @@
     protected override void InitComponent()
     {
         awakeBtn.AddListener(AwakeHero);
+        watchBtn.AddListener(() =>
+        {
+            UIManager.Instance.OpenWindow<HeroAwakePrivewWin>();
+        });
     }
 
     protected override void OnPreOpen()
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index f5da9f2..103df78 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -40,6 +40,7 @@
     [SerializeField] Text awakeLVText;
 
     //灞炴�у尯
+    [SerializeField] ScrollRect allAttrScroll;
     [SerializeField] Button attrBtn;
     [SerializeField] Image unfoldImg; //灞曞紑鏃舵寜閽殑鍥炬爣
     [SerializeField] Image foldImg; //鏀惰捣鏃舵寜閽殑鍥炬爣
@@ -59,7 +60,15 @@
     [SerializeField] Text lvupBtnText;
     [SerializeField] LongPressButton lvupBtn;   //鍗囩骇 绐佺牬
     [SerializeField] Button allAttrBtn;
-    [SerializeField] Text allPotentialText; //娼滆兘
+
+    [SerializeField] GameObject potentialCell; //娼滆兘鍜岃閱掔敤浜庡垱寤�
+    [SerializeField] Transform potentialCellParent; //娼滆兘鐖惰妭鐐�
+    List<GameObject> potentialCellList;   //娼滆兘
+    [SerializeField] Transform awakeCellParent; //娼滆兘鐖惰妭鐐�
+    [SerializeField] GameObject awakeGo;
+    List<GameObject> awakeCellList;   //瑙夐啋
+
+    [SerializeField] GameObject fetterGo;
     [SerializeField] Text[] fetterText;   //缇佺粖
     [SerializeField] Text[] fetterNameText;   //缇佺粖
 
@@ -140,10 +149,13 @@
 
         starBtn.AddListener(() =>
         {
-            SmallTipWin.showText = Language.Get("HeroGift14",hero.heroStar);
+            SmallTipWin.showText = Language.Get("HeroGift14", hero.heroStar);
             SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
             UIManager.Instance.OpenWindow<SmallTipWin>();
         });
+
+        potentialCellList = new List<GameObject>();
+        awakeCellList = new List<GameObject>();
     }
 
 
@@ -156,6 +168,7 @@
         hero = HeroManager.Instance.GetHero(guid);
         unfoldState = false;
         addPerObject.SetActive(false);
+        allAttrScroll.verticalNormalizedPosition = 1;
         Display();
     }
 
@@ -210,6 +223,7 @@
         RefreshAllPotential();
         RefreshFetter();
         RefreshGift();
+        RefreshAwake();
     }
 
     void RefreshItemLockEvent(PackType type, string guid, bool lockState)
@@ -244,6 +258,7 @@
         var index = HeroUIManager.Instance.heroSortList.IndexOf(guid);
         if (index == -1)
             return;
+        allAttrScroll.verticalNormalizedPosition = 1;
         int resultIndex = index + changeValue;
         //寰幆澶勭悊
         if (resultIndex < 0)
@@ -426,8 +441,6 @@
         if (!HeroUIManager.Instance.IsLVMax(hero))
         {
             lvupBtnText.text = Language.Get("L1109");
-            lvupBtn.interactable = true;
-            lvupBtn.SetColorful(null, true);
             lvupMoneyIcon.SetActive(true);
 
             if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero))
@@ -444,13 +457,13 @@
                 lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(lvupConfig.UPCostItem[0]).IconKey);
                 lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], lvupConfig.UPCostItem[1], TextColType.NavyBrown);
             }
+            lvupBtn.SetInteractable(true);
 
         }
         else
         {
             lvupBtnText.text = Language.Get("L1110");
-            lvupBtn.interactable = false;
-            lvupBtn.SetColorful(null, false);
+            lvupBtn.SetInteractable(false);
             lvupMoneyIcon.SetActive(false);
 
         }
@@ -534,26 +547,39 @@
                     Debug.LogError("鏈厤缃妧鑳�" + nextQualityBreakConfig.SkillID);
                 }
             }
-
-
+            if (i >= potentialCellList.Count)
+            {
+                potentialCellList.Add(Instantiate(potentialCell, potentialCellParent));
+            }
+            var go = potentialCellList[i];
+            var descText = go.GetComponent<Text>();
+            var nameText = go.GetComponent<Text>("skillname");
+            go.SetActive(true);
             if (i < hero.breakLevel)
             {
-                allAttrStr += Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr)) + "\n";
+                nameText.text = Language.Get("herocard63", i + 1);
+                descText.text = string.Join(Language.Get("L1112"), attrStrArr);
             }
             else
             {
                 //缃伆
-                allAttrStr += UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr))) + "\n";
+                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1));
+                descText.text = UIHelper.AppendColor(TextColType.NavyGray, string.Join(Language.Get("L1112"), attrStrArr));
             }
         }
-
-        allPotentialText.text = allAttrStr.Trim();
 
     }
 
     //缇佺粖
     void RefreshFetter()
     {
+        if (hero.heroConfig.FetterIDList.Length == 0)
+        { 
+            fetterGo.SetActive(false);
+            return;
+        }
+        fetterGo.SetActive(true);
+
         for (int i = 0; i < fetterText.Length; i++)
         {
             if (i < hero.heroConfig.FetterIDList.Length)
@@ -579,9 +605,9 @@
                     attrStr += Language.Get("L1112") + PlayerPropertyConfig.GetFullDescription(fetterConfig.AttrIDList[j], fetterConfig.AttrValueList[j], format);
                 }
                 fetterText[i].text = attrStr;
-                fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray);
+                fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray);
                 fetterNameText[i].text = fetterConfig.FetterName;
-                fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray);
+                fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.NavyGray);
 
             }
             else
@@ -595,25 +621,25 @@
     {
         HeroUIManager.Instance.RefreshGiftCell(giftBaseCells, hero);
 
-        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId,  hero.Quality))
+        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
         {
             starUPBtnText.text = Language.Get("HeroGift7");
-            starUPBtn.SetInteractable(false); 
+            starUPBtn.SetInteractable(false);
         }
         else if (hero.IsFullStar())
         {
-            starUPBtn.interactable = true;
             starUPBtnText.text = Language.Get("HeroGift3");
+            starUPBtn.SetInteractable(true);
         }
         else
         {
-            starUPBtn.interactable = true;
             starUPBtnText.text = Language.Get("HeroGift3");
+            starUPBtn.SetInteractable(true);
         }
 
     }
 
-    
+
 
     void StarUP()
     {
@@ -637,4 +663,63 @@
         UIManager.Instance.OpenWindow<HeroGiftWashWin>();
 
     }
+
+
+    void RefreshAwake()
+    {
+        if (!HeroAwakeConfig.CanAwake(hero.heroId, 1))
+        {
+            awakeGo.SetActive(false);
+            return;
+        }
+        awakeGo.SetActive(true);
+
+        var maxLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId);
+        var starCnt = HeroQualityConfig.Get(hero.Quality).InitStarUpper;
+        for (int i = 1; i <= maxLV; i++)
+        {
+            if (i > awakeCellList.Count)
+            {
+                awakeCellList.Add(Instantiate(potentialCell, awakeCellParent));
+            }
+            var go = awakeCellList[i - 1];
+            var descText = go.GetComponent<Text>();
+            var nameText = go.GetComponent<Text>("skillname");
+            go.SetActive(true);
+
+            var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, i);
+
+            int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
+            var awakeStr = string.Empty;
+            if (type == 1)
+            {
+                starCnt += config.AddStarUpper;
+                awakeStr = Language.Get("HeroAwake8", config.UnlockTalentSlot, starCnt);
+            }
+            else if (type == 2)
+            {
+                awakeStr = SkillConfig.Get(config.SkillID).Description;
+            }
+            else
+            {
+                for (int k = 0; k < config.AttrIDList.Length; k++)
+                {
+                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k]) +
+                        (k == config.AttrIDList.Length - 1 ? "" : "\n");
+                }
+            }
+
+            if (i - 1 < hero.awakeLevel)
+            {
+                nameText.text = Language.Get("herocard12", i) + Language.Get("L1096");
+                descText.text = awakeStr;
+            }
+            else
+            {
+                //缃伆
+                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096"));
+                descText.text = UIHelper.AppendColor(TextColType.NavyGray, awakeStr);
+            }
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0