From 14a9dc8c9b83dd7627f8ed99a163ebc41c1f9b8e Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 08 九月 2025 00:53:45 +0800
Subject: [PATCH] 117 【武将】武将系统 - 觉醒
---
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs | 90 +++++
Main/System/HeroUI/HeroAwakeSuccessWin.cs | 92 +++++
Main/System/HeroUI/HeroUIManager.Talent.cs | 2
Main/System/HeroUI/HeroAwakeWin.cs.meta | 11
Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs | 383 +++++++++++----------
Main/System/HeroUI/HeroAwakeCell.cs.meta | 11
Main/System/HeroUI/HeroAwakeWin.cs | 165 +++++++++
Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs | 9
Main/System/Hero/HeroInfo.Talent.cs | 11
Main/Utility/UIHelper.cs | 6
Main/System/HeroUI/HeroAwakeCell.cs | 72 ++++
Main/System/HeroUI/HeroUIManager.Awake.cs.meta | 11
Main/Config/PartialConfigs/SkillConfig.Partial.cs | 40 +
Main/Config/PartialConfigs/HeroAwakeConfig.cs | 2
Main/System/HeroUI/HeroShowBaseCell.cs | 52 +-
Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta | 11
Main/System/HeroUI/HeroUIManager.Awake.cs | 16
Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta | 11
Main/System/HeroUI/HeroTrainWin.cs | 11
Main/System/HeroUI/HeroUIManager.cs | 16
20 files changed, 786 insertions(+), 236 deletions(-)
diff --git a/Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs b/Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs
index 52a0236..48d2ba6 100644
--- a/Main/Component/UI/Decorate/Tweens/UIAlphaTween.cs
+++ b/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,
+ }
+
+}
+
diff --git a/Main/Config/PartialConfigs/HeroAwakeConfig.cs b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
index bb89580..52466ce 100644
--- a/Main/Config/PartialConfigs/HeroAwakeConfig.cs
+++ b/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)
diff --git a/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs b/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
index 7bfedeb..ce1c0b5 100644
--- a/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
+++ b/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);
}
diff --git a/Main/Config/PartialConfigs/SkillConfig.Partial.cs b/Main/Config/PartialConfigs/SkillConfig.Partial.cs
index 4774a7e..fd807b9 100644
--- a/Main/Config/PartialConfigs/SkillConfig.Partial.cs
+++ b/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;
+ }
}
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index 668862d..38ad22d 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/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()
diff --git a/Main/System/HeroUI/HeroAwakeCell.cs b/Main/System/HeroUI/HeroAwakeCell.cs
new file mode 100644
index 0000000..5fcd1b6
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeCell.cs
@@ -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();
+ }
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroAwakeCell.cs.meta b/Main/System/HeroUI/HeroAwakeCell.cs.meta
new file mode 100644
index 0000000..7330c75
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 87307568b66763849ba8f069d6bbff61
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs b/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs
new file mode 100644
index 0000000..ab7a4b8
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs
@@ -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();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta b/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta
new file mode 100644
index 0000000..bb42260
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeSelectGiftWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a904e9bfc7697c647ac4bc89145cb27f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroAwakeSuccessWin.cs b/Main/System/HeroUI/HeroAwakeSuccessWin.cs
new file mode 100644
index 0000000..022dce9
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeSuccessWin.cs
@@ -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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta b/Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta
new file mode 100644
index 0000000..513d6dc
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeSuccessWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2ba19268b52375a40852747b77c35768
+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
new file mode 100644
index 0000000..e95d23a
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeWin.cs
@@ -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();
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAwakeWin.cs.meta b/Main/System/HeroUI/HeroAwakeWin.cs.meta
new file mode 100644
index 0000000..6ab5ff8
--- /dev/null
+++ b/Main/System/HeroUI/HeroAwakeWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0dd0e19e2e4c00e44ae620f9fe41b4c2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroShowBaseCell.cs b/Main/System/HeroUI/HeroShowBaseCell.cs
index 4f097ca..cc86c69 100644
--- a/Main/System/HeroUI/HeroShowBaseCell.cs
+++ b/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 @@
}
//缂╂斁鍒板拰鐖秗ect涓�鏍峰ぇ
- 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;
}
}
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 9a4583b..f5da9f2 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/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>();
diff --git a/Main/System/HeroUI/HeroUIManager.Awake.cs b/Main/System/HeroUI/HeroUIManager.Awake.cs
new file mode 100644
index 0000000..733cde1
--- /dev/null
+++ b/Main/System/HeroUI/HeroUIManager.Awake.cs
@@ -0,0 +1,16 @@
+锘縰sing 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>(); //浼氭湁閲嶅鐨処D锛屼笉瑕佺敤瀛楀吀
+ public List<int> heroBeforeAwakeGiftLevelList = new List<int>();
+
+}
+
diff --git a/Main/System/HeroUI/HeroUIManager.Awake.cs.meta b/Main/System/HeroUI/HeroUIManager.Awake.cs.meta
new file mode 100644
index 0000000..8069fcd
--- /dev/null
+++ b/Main/System/HeroUI/HeroUIManager.Awake.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 22cea3f17d6c6bd4f9b1fe7c97fb179a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
index 793db64..02be11e 100644
--- a/Main/System/HeroUI/HeroUIManager.Talent.cs
+++ b/Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -87,7 +87,7 @@
- //鏄熶笂闄愮敱鍝佽川 鍜� 瑙夐啋鍐冲畾
+ //鏄熸渶缁堜笂闄愮敱鍝佽川 鍜� 瑙夐啋鍐冲畾
public int GetMaxStarCount(int heroID, int quality)
{
if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 429d79e..f68c4f4 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/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
\ No newline at end of file
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 84dc837..dfdf1ac 100644
--- a/Main/Utility/UIHelper.cs
+++ b/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
--
Gitblit v1.8.0