hch
2025-09-08 51f023b1ef1842dffc7a17e8da3286f46d067199
117 【武将】武将系统 - 潜能 觉醒总览描述
2个文件已修改
2个文件已添加
226 ■■■■■ 已修改文件
Main/System/HeroUI/HeroAwakePrivewWin.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakePrivewWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakePrivewWin.cs
New file
@@ -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);
            }
        }
    }
}
Main/System/HeroUI/HeroAwakePrivewWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 39388fec8991cad4ca7412dba0ec9860
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
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()
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);
            }
        }
    }
}