hch
2025-09-08 14a9dc8c9b83dd7627f8ed99a163ebc41c1f9b8e
117 【武将】武将系统 - 觉醒
10个文件已修改
10个文件已添加
1022 ■■■■ 已修改文件
Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs 383 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/HeroAwakeConfig.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/SkillConfig.Partial.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Talent.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeCell.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeSuccessWin.cs 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeWin.cs 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroAwakeWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroShowBaseCell.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Awake.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Awake.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Talent.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/UIHelper.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs
@@ -7,222 +7,237 @@
using UnityEngine.UI;
using System;
    [RequireComponent(typeof(CanvasGroup))]
    public class UIAlphaTween : MonoBehaviour
[RequireComponent(typeof(CanvasGroup))]
public class UIAlphaTween : MonoBehaviour
{
    public TweenCurve curve;
    [Range(0, 1)]
    public float from;
    [Range(0, 1)]
    public float to;
    public float delay = 0f;
    public float duration = 1f;
    public Trigger trigger = Trigger.Manual;
    public WrapMode wrapMode;
    public bool reversal;
    CanvasGroup m_CanvasGroup;
    public CanvasGroup canvasGroup {
        get {
            return m_CanvasGroup ?? (m_CanvasGroup = this.GetComponent<CanvasGroup>());
        }
    }
    protected float accumulatedTime;
    protected float curveLength;
    protected bool doTween = false;
    Action onPlayEndCallBack;
    public void SetStartState()
    {
        public TweenCurve curve;
        [Range(0, 1)]
        public float from;
        [Range(0, 1)]
        public float to;
        public float delay = 0f;
        public float duration = 1f;
        public Trigger trigger = Trigger.Manual;
        public WrapMode wrapMode;
        public bool reversal;
        canvasGroup.alpha = from;
    }
        CanvasGroup m_CanvasGroup;
        public CanvasGroup canvasGroup {
            get {
                return m_CanvasGroup ?? (m_CanvasGroup = this.GetComponent<CanvasGroup>());
            }
        }
    public void SetEndState()
    {
        canvasGroup.alpha = to;
    }
        protected float accumulatedTime;
        protected float curveLength;
        protected bool doTween = false;
        Action onPlayEndCallBack;
        public void SetStartState()
    public void Play()
    {
        onPlayEndCallBack = null;
        reversal = false;
        StopAllCoroutines();
        if (this.gameObject.activeInHierarchy)
        {
            canvasGroup.alpha = from;
        }
        public void SetEndState()
        {
            canvasGroup.alpha = to;
        }
        public void Play()
        {
            onPlayEndCallBack = null;
            reversal = false;
            StopAllCoroutines();
            if (this.gameObject.activeInHierarchy)
            {
                SetStartState();
                StartCoroutine("Co_StartTween");
            }
        }
        public void Play(bool _reversal)
        {
            onPlayEndCallBack = null;
            reversal = _reversal;
            StopAllCoroutines();
            if (this.gameObject.activeInHierarchy)
            {
                if (_reversal)
                {
                    SetEndState();
                }
                else
                {
                    SetStartState();
                }
                StartCoroutine("Co_StartTween");
            }
        }
        public void Play(Action _callBack)
        {
            onPlayEndCallBack = _callBack;
            reversal = false;
            StopAllCoroutines();
            if (this.gameObject.activeInHierarchy)
            {
                SetStartState();
                StartCoroutine("Co_StartTween");
            }
        }
        public void Stop()
        {
            doTween = false;
            accumulatedTime = 0f;
            StopAllCoroutines();
            SetStartState();
            StartCoroutine("Co_StartTween");
        }
    }
        void Start()
    public void Play(bool _reversal)
    {
        onPlayEndCallBack = null;
        reversal = _reversal;
        StopAllCoroutines();
        if (this.gameObject.activeInHierarchy)
        {
            if (trigger == Trigger.Start)
            if (_reversal)
            {
                SetEndState();
            }
            else
            {
                SetStartState();
                StartCoroutine("Co_StartTween");
            }
        }
        protected virtual void OnEnable()
        {
            if (trigger == Trigger.Enable)
            {
                SetStartState();
                StartCoroutine("Co_StartTween");
            }
        }
        protected virtual void OnDisable()
        {
            doTween = false;
            accumulatedTime = 0f;
            StopAllCoroutines();
        }
        void LateUpdate()
        {
            if (doTween && duration > 0.001f)
            {
                accumulatedTime += Time.deltaTime;
                UpdateAlpha();
            }
        }
        IEnumerator Co_StartTween()
        {
            if (delay < 0f)
            {
                Debug.LogError("Delaytime should not be less than zero!");
                yield break;
            }
            if (duration < 0.001f)
            {
                Debug.LogError("Duration should not be less than zero!");
                yield break;
            }
            if (curve.keys.Length < 2)
            {
                Debug.LogError("不正确的曲线!");
                yield break;
            }
            doTween = false;
            OnPrepare();
            yield return new WaitForSeconds(delay);
            curveLength = curve.keys[curve.keys.Length - 1].time - curve.keys[0].time;
            doTween = true;
            accumulatedTime = 0f;
            StartCoroutine("Co_StartTween");
        }
    }
        protected void UpdateAlpha()
    public void Play(Action _callBack)
    {
        onPlayEndCallBack = _callBack;
        reversal = false;
        StopAllCoroutines();
        if (this.gameObject.activeInHierarchy)
        {
            float t = 0f;
            switch (wrapMode)
            {
                case WrapMode.Once:
                    t = (accumulatedTime / duration) * curveLength;
                    break;
                case WrapMode.Loop:
                    t = Mathf.Repeat((accumulatedTime / duration) * curveLength, 1);
                    break;
                case WrapMode.PingPong:
                    t = Mathf.PingPong((accumulatedTime / duration) * curveLength, 1);
                    break;
            }
            var value = curve.Evaluate(reversal ? curveLength - t : t);
            canvasGroup.alpha = Mathf.LerpUnclamped(from, to, value);
            switch (wrapMode)
            {
                case WrapMode.Once:
                    if (t > curveLength && doTween)
                    {
                        OnOnceEnd();
                        doTween = false;
                    }
                    break;
            }
            SetStartState();
            StartCoroutine("Co_StartTween");
        }
    }
        protected virtual void OnPrepare()
    public void Stop()
    {
        doTween = false;
        accumulatedTime = 0f;
        StopAllCoroutines();
        SetStartState();
    }
    void Start()
    {
        if (trigger == Trigger.Start)
        {
            SetStartState();
            StartCoroutine("Co_StartTween");
        }
    }
        protected virtual void OnOnceEnd()
    protected virtual void OnEnable()
    {
        if (trigger == Trigger.Enable)
        {
            if (onPlayEndCallBack != null)
            {
                onPlayEndCallBack();
                onPlayEndCallBack = null;
            }
            SetStartState();
            StartCoroutine("Co_StartTween");
        }
    }
        protected virtual void UpdateVector3()
    protected virtual void OnDisable()
    {
        doTween = false;
        accumulatedTime = 0f;
        StopAllCoroutines();
    }
    void LateUpdate()
    {
        if (doTween && duration > 0.001f)
        {
            accumulatedTime += Time.deltaTime;
            UpdateAlpha();
        }
    }
        public enum Trigger
    IEnumerator Co_StartTween()
    {
        if (delay < 0f)
        {
            Manual,
            Start,
            Enable,
            Debug.LogError("Delaytime should not be less than zero!");
            yield break;
        }
        if (duration < 0.001f)
        {
            Debug.LogError("Duration should not be less than zero!");
            yield break;
        }
        public enum WrapMode
        if (curve.keys.Length < 2)
        {
            Once,
            Loop,
            PingPong,
            Debug.LogError("不正确的曲线!");
            yield break;
        }
        doTween = false;
        OnPrepare();
        yield return new WaitForSeconds(delay);
        curveLength = curve.keys[curve.keys.Length - 1].time - curve.keys[0].time;
        doTween = true;
        accumulatedTime = 0f;
    }
    protected void UpdateAlpha()
    {
        float t = 0f;
        switch (wrapMode)
        {
            case WrapMode.Once:
                t = (accumulatedTime / duration) * curveLength;
                break;
            case WrapMode.Loop:
                t = Mathf.Repeat((accumulatedTime / duration) * curveLength, 1);
                break;
            case WrapMode.PingPong:
                t = Mathf.PingPong((accumulatedTime / duration) * curveLength, 1);
                break;
            case WrapMode.PingPongOnce:
                t = Mathf.PingPong((accumulatedTime / (duration/2)) * curveLength, 1);
                break;
        }
        var value = curve.Evaluate(reversal ? curveLength - t : t);
        canvasGroup.alpha = Mathf.LerpUnclamped(from, to, value);
        switch (wrapMode)
        {
            case WrapMode.Once:
            case WrapMode.PingPongOnce:
                if (accumulatedTime > duration && doTween)
                {
                    OnOnceEnd();
                    doTween = false;
                }
                break;
        }
    }
    protected virtual void OnPrepare()
    {
    }
    protected virtual void OnOnceEnd()
    {
        if (wrapMode == WrapMode.PingPongOnce)
        {
            SetStartState();
        }
        else
        {
            canvasGroup.alpha = reversal ? from : to;
        }
        if (onPlayEndCallBack != null)
        {
            onPlayEndCallBack();
            onPlayEndCallBack = null;
        }
    }
    protected virtual void UpdateVector3()
    {
    }
    public enum Trigger
    {
        Manual,
        Start,
        Enable,
    }
    public enum WrapMode
    {
        Once,
        Loop,
        PingPong,
        PingPongOnce,
    }
}
Main/Config/PartialConfigs/HeroAwakeConfig.cs
@@ -46,7 +46,7 @@
    public static bool CanAwake(int heroID, int awakeLv)
    {
        return GetHeroAwakeConfig(heroID, awakeLv) == null;
        return GetHeroAwakeConfig(heroID, awakeLv) != null;
    }
    public static int GetAwakeLVByUnLockGiftIndex(int heroID, int index)
Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
@@ -10,7 +10,7 @@
{
    //    Quality, Dictionary<AwakeLV, UPCostItem>
    public static Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>> costDics = new Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>>();
    static Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>> costDics = new Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>>();
    protected override void OnConfigParseCompleted()
    {
@@ -18,9 +18,10 @@
        
        Dictionary<int, HeroQualityAwakeConfig> tempDic = null;
        if (!costDics.TryGetValue(Quality, out tempDic))
        {
            tempDic = new Dictionary<int, HeroQualityAwakeConfig>();
        if (!costDics.TryGetValue(Quality, out tempDic))
        {
            tempDic = new Dictionary<int, HeroQualityAwakeConfig>();
            costDics.Add(Quality, tempDic);
        }
Main/Config/PartialConfigs/SkillConfig.Partial.cs
@@ -17,6 +17,8 @@
    public SkillEffectType effectType;
    //技能类型:技能等级:技能
    static Dictionary<int, Dictionary<int, SkillConfig>> skillDics = new Dictionary<int, Dictionary<int, SkillConfig>>();
    protected override void OnConfigParseCompleted()
    {
        base.OnConfigParseCompleted();
@@ -24,19 +26,39 @@
        skillType = (SkillType)SkillType;
        castMode = (SkillCastMode)CastPosition;
        effectType = (SkillEffectType)EffectType;
// #if UNITY_EDITOR
//         if (Launch.Instance.isOpenBattleDebug)
//         {
//             if (castMode == SkillCastMode.None)
//             {
//                 castMode = SkillCastMode.Target;
//             }
//         }
// #endif
        // #if UNITY_EDITOR
        //         if (Launch.Instance.isOpenBattleDebug)
        //         {
        //             if (castMode == SkillCastMode.None)
        //             {
        //                 castMode = SkillCastMode.Target;
        //             }
        //         }
        // #endif
        Dictionary<int, SkillConfig> tempDic = null;
        if (!skillDics.TryGetValue((int)skillType, out tempDic))
        {
            tempDic = new Dictionary<int, SkillConfig>();
            skillDics.Add((int)skillType, tempDic);
        }
        tempDic[SkillLV] = this;
    }
    public MotionName GetMotionName()
    {
        return Enum.Parse<MotionName>(SkillMotionName);
    }
    public static SkillConfig GetSkillConfig(int skillType, int skillLv)
    {
        Dictionary<int, SkillConfig> tempDic = null;
        if (!skillDics.TryGetValue(skillType, out tempDic))
        {
            return null;
        }
        SkillConfig config = null;
        tempDic.TryGetValue(skillLv, out config);
        return config;
    }
}
Main/System/Hero/HeroInfo.Talent.cs
@@ -114,18 +114,23 @@
    //判断当前是否满星
    public bool IsFullStar()
    {
        return heroStar >= GetCurMaxStar();
    }
    //当前能达到的最大星级
    public int GetCurMaxStar()
    {
        if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null)
        {
            return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
            return HeroQualityConfig.Get(Quality).InitStarUpper;
        }
        //根据觉醒累计提升星上限
        int addStarCount = 0;
        for (int i = 1; i <= awakeLevel; i++)
        {
            addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
        }
        return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
        return HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
    }
    public bool IsFullGift()
Main/System/HeroUI/HeroAwakeCell.cs
New file
@@ -0,0 +1,72 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
public class HeroAwakeCell : MonoBehaviour
{
    [SerializeField] UIEffectPlayer fireEffect;
    [SerializeField] Image selectImg;
    [SerializeField] Image bgImg;
    [SerializeField] Image attrTypeImg;
    [SerializeField] Text attrText;
    [SerializeField] UIEffectPlayer activeEffect;
    [SerializeField] Text awakeLVText;
    [SerializeField] Image lineImg;
    public void Display(HeroInfo hero, int awakeLV)
    {
        var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV);
        if (hero.awakeLevel < awakeLV)
        {
            //未激活
            fireEffect.Stop();
            selectImg.SetActive(hero.awakeLevel + 1 == awakeLV);
        }
        else
        {
            fireEffect.Play();
            selectImg.SetActive(false);
        }
        //1 天赋 2技能 3属性
        int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
        attrTypeImg.SetSprite("heroattrtype" + type);
        bgImg.SetSprite("heroawakebg" + type);
        if (type == 1)
        {
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("HeroAwake4"), false);
        }
        else if (type == 2)
        {
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("herocard16"), false);
        }
        else
        {
            string attrStr = "";
            for (int i = 0; i < config.AttrIDList.Length; i++)
            {
                attrStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[i], config.AttrValueList[i]) +
                    (i == config.AttrIDList.Length - 1 ? "" : "\n");
            }
            attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, attrStr, false);
        }
        awakeLVText.text = awakeLV.ToString();
        lineImg.SetActive(hero.awakeLevel >= awakeLV);
    }
    public void ShowActiveEffect(HeroInfo hero, int awakeLV)
    {
        var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV);
        //1 天赋 2技能 3属性
        int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3;
        if (type != 3)
            return;
        if (hero.awakeLevel + 1 == awakeLV)
        {
            activeEffect.Play();
        }
    }
}
Main/System/HeroUI/HeroAwakeCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87307568b66763849ba8f069d6bbff61
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs
New file
@@ -0,0 +1,90 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将觉醒选择天赋界面
/// </summary>
public class HeroAwakeSelectGiftWin : UIBase
{
    [SerializeField] GameObject[] slectGos;
    [SerializeField] Button[] giftBtns;
    [SerializeField] GiftBaseCell[] giftCells;
    [SerializeField] Text[] skillText;
    [SerializeField] Button okBtn;
    int selectIndex = 0;
    protected override void InitComponent()
    {
        okBtn.AddListener(SelectGift);
        for (int i = 0; i < giftBtns.Length; i++)
        {
            int index = i;
            giftBtns[i].AddListener(() =>
            {
                selectIndex = index;
                Display();
            });
        }
    }
    protected override void OnPreOpen()
    {
        selectIndex = 0;
        Display();
    }
    public void Display()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
        if (hero == null)
        {
            return;
        }
        for (int i = 0; i < giftBtns.Length; i++)
        {
            slectGos[i].SetActive(i == selectIndex);
            if (i < hero.talentAwakeRandomIDList.Count)
            {
                giftCells[i].Init(hero.talentAwakeRandomIDList[i], 1);
                var giftConfig = HeroTalentConfig.Get(hero.talentAwakeRandomIDList[i]);
                skillText[i].text = PlayerPropertyConfig.GetFullDescription(giftConfig.AttrID, giftConfig.AttrValue);
            }
        }
    }
    void SelectGift()
    {
        ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HeroAwake7"), (bool isOK) =>
            {
                if (isOK)
                {
                    var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
                    if (hero == null)
                    {
                        return;
                    }
                    HeroUIManager.Instance.heroBeforeAwakeGiftIDList = new List<int>(hero.talentIDList);
                    HeroUIManager.Instance.heroBeforeAwakeGiftLevelList = new List<int>(hero.talentLvList);
                    HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse()
                    {
                        guid = HeroUIManager.Instance.selectAwakeHeroGuid,
                        type = HeroFuncType.Awake,
                        time = Time.time
                    };
                    var pack = new CB234_tagCSHeroAwakeSelectTalent();
                    pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
                    pack.SelectIndex = (byte)selectIndex;
                    GameNetSystem.Instance.SendInfo(pack);
                    CloseWindow();
                }
            });
    }
}
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a904e9bfc7697c647ac4bc89145cb27f
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroAwakeSuccessWin.cs
New file
@@ -0,0 +1,92 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将觉醒成功界面
/// </summary>
public class HeroAwakeSuccessWin : UIBase
{
    [SerializeField] HeroShowBaseCell heroShow;
    [SerializeField] Text beforeAwakeLVText;
    [SerializeField] Text afterAwakeLVText;
    [SerializeField] GameObject skillGo;
    [SerializeField] GameObject talentGo;
    //技能
    [SerializeField] Text beforeSkillText;
    [SerializeField] Text afterSkillText;
    //天赋
    [SerializeField] Text beforeStarText;
    [SerializeField] Text afterStarText;
    [SerializeField] GiftBaseCell[] giftBaseCellArr;
    [SerializeField] Button okBtn;
    protected override void InitComponent()
    {
        okBtn.AddListener(CloseWindow);
    }
    protected override void OnPreOpen()
    {
        if (string.IsNullOrEmpty(HeroUIManager.Instance.selectAwakeHeroGuid))
            return;
        Display();
    }
    public void Display()
    {
        HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
        if (hero == null)
            return;
        heroShow.Init(hero.heroId, hero.SkinID);
        beforeAwakeLVText.text = Language.Get("herocard12", hero.awakeLevel - 1);
        afterAwakeLVText.text = Language.Get("herocard12", hero.awakeLevel);
        var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel);
        if (config.UnlockTalentSlot == 0)
        {
            talentGo.SetActive(false);
            skillGo.SetActive(true);
            //技能
            var skill = SkillConfig.Get(config.SkillID);
            if (skill.SkillLV == 1)
            {
                beforeSkillText.text = Language.Get("HeroAwake6");
            }
            else
            {
                var beforeSkill = SkillConfig.GetSkillConfig(skill.SkillType, skill.SkillLV - 1);
                beforeSkillText.text = beforeSkill.Description;
            }
            afterSkillText.text = skill.Description;
        }
        else
        {
            talentGo.SetActive(true);
            skillGo.SetActive(false);
            var maxStar = hero.GetCurMaxStar();
            beforeStarText.text = (maxStar - config.AddStarUpper).ToString();
            afterStarText.text = maxStar.ToString();
            //天赋
            HeroUIManager.Instance.RefreshGiftCell(giftBaseCellArr, hero, HeroUIManager.Instance.heroBeforeAwakeGiftIDList,
            HeroUIManager.Instance.heroBeforeAwakeGiftLevelList);
        }
    }
}
Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2ba19268b52375a40852747b77c35768
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroAwakeWin.cs
New file
@@ -0,0 +1,165 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将觉醒界面
/// </summary>
public class HeroAwakeWin : UIBase
{
    [SerializeField] HeroAwakeCell[] heroAwakeCellList;
    [SerializeField] Image itemIcon;
    [SerializeField] Text valueText;
    [SerializeField] Button awakeBtn;
    [SerializeField] Text activeTipText;
    [SerializeField] GameObject fullGo;
    [SerializeField] Button watchBtn;
    [SerializeField] HeroShowBaseCell heroShow;
    [SerializeField] UIAlphaTween alphaTween;
    protected override void InitComponent()
    {
        awakeBtn.AddListener(AwakeHero);
    }
    protected override void OnPreOpen()
    {
        alphaTween.Stop();
        HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
        Display();
    }
    protected override void OnPreClose()
    {
        HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
    }
    protected override void OnOpen()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
        if (hero == null)
        {
            return;
        }
        if (hero.talentAwakeRandomIDList.Count > 0)
        {
            UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>();
        }
    }
    public void Display()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
        if (hero == null)
        {
            return;
        }
        heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel);
        int maxLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId);
        int startLV = hero.awakeLevel == maxLV ? (hero.awakeLevel / 6 - 1) * 6 + 1 : hero.awakeLevel / 6 * 6 + 1;
        for (int i = 0; i < heroAwakeCellList.Length; i++)
        {
            heroAwakeCellList[i].Display(hero, startLV + i);
        }
        if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
        {
            awakeBtn.SetActive(false);
            activeTipText.SetActive(true);
            fullGo.SetActive(false);
            activeTipText.text = Language.Get("HeroAwake5", hero.heroStar, HeroUIManager.Instance.canWashStarLevel);
        }
        else if (hero.awakeLevel == HeroAwakeConfig.GetMaxAwakeLV(hero.heroId))
        {
            awakeBtn.SetActive(false);
            fullGo.SetActive(true);
            activeTipText.SetActive(false);
        }
        else
        {
            awakeBtn.SetActive(true);
            activeTipText.SetActive(false);
            fullGo.SetActive(false);
            var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel);
            int itemID = config.UPCostItem[0];
            int useCount = config.UPCostItem[1];
            itemIcon.SetItemSprite(itemID);
            valueText.text = UIHelper.ShowUseItem(PackType.Item, itemID, useCount);
        }
    }
    void AwakeHero()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid);
        if (hero == null)
        {
            return;
        }
        var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel);
        if (config.UPCostItem.IsNullOrEmpty())
            return;
        int itemID = config.UPCostItem[0];
        int useCount = config.UPCostItem[1];
        if (!ItemLogicUtility.CheckItemCount(PackType.Item, itemID, useCount, 2))
        {
            return;
        }
        if (hero.talentAwakeRandomIDList.Count > 0)
        {
            //防范未选择天赋
            UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>();
            return;
        }
        var pack = new CB233_tagCSHeroAwake();
        pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
        GameNetSystem.Instance.SendInfo(pack);
        var nextConfig = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel + 1);
        if (nextConfig.UnlockTalentSlot > 0 || nextConfig.SkillID > 0)
        {
            //设置个等待回复的标识 显示成功界面;技能强化显示成功界面,天赋先显示选择界面再显示成功界面
            HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse()
            {
                guid = HeroUIManager.Instance.selectAwakeHeroGuid,
                type = HeroFuncType.Awake,
                time = Time.time
            };
        }
        //下一格播放特效
        int startLV = hero.awakeLevel / 6 * 6 + 1;
        heroAwakeCellList[hero.awakeLevel - startLV + 1].ShowActiveEffect(hero, hero.awakeLevel + 1);
        //切换轮的时候做个表现
        if (hero.awakeLevel % 6 == 5)
        {
            alphaTween.Play();
        }
    }
    void OnHeroChangeEvent(HeroInfo hero)
    {
        if (hero.itemHero.guid != HeroUIManager.Instance.selectAwakeHeroGuid)
        {
            return;
        }
        Display();
    }
}
Main/System/HeroUI/HeroAwakeWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0dd0e19e2e4c00e44ae620f9fe41b4c2
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroShowBaseCell.cs
@@ -39,7 +39,7 @@
        {
            if (m_StarRect == null)
            {
                m_StarRect = this.transform.Find("Container_HeroShow/layout/stars");
                m_StarRect = this.transform.Find("Container_HeroShow/layout/layout/stars");
            }
            return m_StarRect;
        }
@@ -55,7 +55,7 @@
                m_StarsImg = new List<Image>();
                for (int i = 0; i < 5; i++)
                {
                    var star = this.transform.GetComponent<Image>("Container_HeroShow/layout/stars/star" + i);
                    var star = this.transform.GetComponent<Image>("Container_HeroShow/layout/layout/stars/star" + i);
                    m_StarsImg.Add(star);
                }
            }
@@ -84,7 +84,7 @@
        {
            if (m_Name == null)
            {
                m_Name = this.transform.GetComponent<Text>("Container_HeroShow/name");
                m_Name = this.transform.GetComponent<Text>("Container_HeroShow/layout/name");
            }
            return m_Name;
        }
@@ -98,7 +98,7 @@
        {
            if (m_LvText == null)
            {
                m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/layout/lv");
                m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/layout/layout/lv");
            }
            return m_LvText;
        }
@@ -111,7 +111,7 @@
        {
            if (m_LvTextOutline == null)
            {
                m_LvTextOutline = this.transform.GetComponent<OutlineEx>("Container_HeroShow/layout/lv");
                m_LvTextOutline = this.transform.GetComponent<OutlineEx>("Container_HeroShow/layout/layout/lv");
            }
            return m_LvTextOutline;
        }
@@ -165,8 +165,16 @@
        nameText.text = breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, breakLevel);
        nameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
        lvText.text = string.Format("{0}{1} {2}", Language.Get("L1094"), lv, awakelv == 0 ? Language.Get("herocard13") : Language.Get("herocard12", awakelv));
        heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red;
        if (lv == 0)
        {
            lvText.SetActive(false);
        }
        else
        {
            lvText.SetActive(true);
            lvText.text = string.Format("{0}{1} {2}", Language.Get("L1094"), lv, awakelv == 0 ? Language.Get("herocard13") : Language.Get("herocard12", awakelv));
            heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red;
        }
    }
@@ -194,22 +202,22 @@
        }
        //缩放到和父rect一样大
        var scale = 1f;
        var rect = cellContainer.GetComponent<RectTransform>();
        var parentRect = transform.GetComponent<RectTransform>();
        float width = parentRect.sizeDelta.x;
        if (width <= 0f)
        {
            //外部控制了尺寸获取为0
            GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
            if (grid != null)
            {
                width = grid.cellSize.x;
            }
        // var scale = 1f;
        // var rect = cellContainer.GetComponent<RectTransform>();
        // var parentRect = transform.GetComponent<RectTransform>();
        // float width = parentRect.sizeDelta.x;
        // if (width <= 0f)
        // {
        //     //外部控制了尺寸获取为0
        //     GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
        //     if (grid != null)
        //     {
        //         width = grid.cellSize.x;
        //     }
        }
        scale = width / rect.sizeDelta.x;
        cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
        // }
        // scale = width / rect.sizeDelta.x;
        // cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
    }
}
Main/System/HeroUI/HeroTrainWin.cs
@@ -57,7 +57,7 @@
    [SerializeField] Image lvupMoneyIcon;
    [SerializeField] Text lvupMoneyText;
    [SerializeField] Text lvupBtnText;
    [SerializeField] LongPressButton lvupBtn;
    [SerializeField] LongPressButton lvupBtn;   //升级 突破
    [SerializeField] Button allAttrBtn;
    [SerializeField] Text allPotentialText; //潜能
    [SerializeField] Text[] fetterText;   //羁绊
@@ -102,7 +102,8 @@
        deleteBtn.AddListener(DeleteHero);
        awakeBtn.AddListener(() =>
        {
            // UIManager.Instance.OpenWindow<HeroAwakeWin>(hero.heroId);
            HeroUIManager.Instance.selectAwakeHeroGuid = guid;
            UIManager.Instance.OpenWindow<HeroAwakeWin>();
        });
        inheritText.OnClick = () =>
        {
@@ -632,12 +633,6 @@
    void Wash()
    {
        if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel);
            return;
        }
        HeroUIManager.Instance.selectWashHeroGUID = hero.itemHero.guid;
        UIManager.Instance.OpenWindow<HeroGiftWashWin>();
Main/System/HeroUI/HeroUIManager.Awake.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//觉醒
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
    public string selectAwakeHeroGuid;
    public List<int> heroBeforeAwakeGiftIDList = new List<int>();    //会有重复的ID,不要用字典
    public List<int> heroBeforeAwakeGiftLevelList = new List<int>();
}
Main/System/HeroUI/HeroUIManager.Awake.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 22cea3f17d6c6bd4f9b1fe7c97fb179a
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -87,7 +87,7 @@
    //星上限由品质 和 觉醒决定
    //星最终上限由品质 和 觉醒决定
    public int GetMaxStarCount(int heroID, int quality)
    {
        if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
Main/System/HeroUI/HeroUIManager.cs
@@ -84,6 +84,18 @@
        {
            UIManager.Instance.OpenWindow<HeroGiftEatSuccessWin>();
        }
        else if (waitResponse.type == HeroFuncType.Awake)
        {
            var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel);
            if (hero.talentAwakeRandomIDList.Count > 0)
            {
                UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>();
            }
            else if (config.SkillID != 0 || config.UnlockTalentSlot != 0)
            {
                UIManager.Instance.OpenWindow<HeroAwakeSuccessWin>();
            }
        }
        waitResponse = default;
    }
@@ -304,6 +316,7 @@
}
#region 等待服务端响应
public struct WaitHeroFuncResponse
{
    public HeroFuncType type;
@@ -317,5 +330,6 @@
    None = 0,   //无功能
    Break = 1,  //突破
    Gift  = 2,  //天赋吞噬
    Awake = 3,  //觉醒
}
#endregion
Main/Utility/UIHelper.cs
@@ -676,7 +676,7 @@
                // 5d1d52 永恒
                return new Color32(93, 29, 82, 128);
            case QualityTextColType.red:
                return s_BrightRedColor;
                return s_DarkRedColor;
        }
        return new Color32(0, 0, 0, 128);
    }
@@ -1129,13 +1129,13 @@
    public static string ShowUseMoney(int moneyType, long useCnt, TextColType engoughColor = TextColType.Green)
    {
        long cnt = GetMoneyCnt(moneyType);
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}");
    }
    public static string ShowUseItem(PackType type, int itemId, long useCnt, TextColType engoughColor = TextColType.Green)
    {
        long cnt = PackManager.Instance.GetItemCountByID(type, itemId);
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}");
    }
    #endregion