From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/HeroUI/HeroUIManager.Talent.cs | 143 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 135 insertions(+), 8 deletions(-)
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
index f9e2057..8302b51 100644
--- a/Main/System/HeroUI/HeroUIManager.Talent.cs
+++ b/Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -4,6 +4,7 @@
using LitJson;
using UnityEngine;
+using UnityEngine.UI;
//澶╄祴
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
@@ -17,7 +18,34 @@
public int[] washByLockUseCounts;
public int canWashStarLevel; //杈惧埌X鏄熷彲浠ユ礂缁�
- public string selectHeroGuidForGiftFunc;
+ public string selectHeroGuidForGiftFunc;//姝﹀皢涓讳綋GUID
+
+ public int eatHeroIDForResult; //绛夊緟鍚炲櫖缁撴灉姝﹀皢ID 涓轰簡寮规垚鍔熺晫闈娇鐢�
+ public string selectHeroGuidForGiftFuncForSuccessWin; //绛夊緟鏈嶅姟鍣ㄨ繑鍥炵殑姝﹀皢GUID 鏄剧ず鎴愬姛鐣岄潰鍐呭
+ public List<int> heroBeforeGiftIDList = new List<int>(); //浼氭湁閲嶅鐨処D锛屼笉瑕佺敤瀛楀吀
+ public List<int> heroBeforeGiftLevelList = new List<int>();
+
+
+ public event Action SelectEatHeroEvent;
+ string m_SelectEatHeroGuid; //琚悶鍣灏咷UID
+ public string selectEatHeroGuid
+ {
+ get { return m_SelectEatHeroGuid; }
+ set
+ {
+ m_SelectEatHeroGuid = value;
+ SelectEatHeroEvent?.Invoke();
+ }
+ }
+
+ #region 娲楃偧
+ public string selectWashHeroGUID; //琚礂缁冩灏咷UID
+ public Action changeLockEvent;
+
+ #endregion
+
+ public List<string> heroEatList = new List<string>();
+
void ParseGiftConfig()
{
@@ -36,7 +64,13 @@
//鏍规嵁澶╄祴閿佺姸鎬佽幏鍙栨秷鑰楃殑鏉愭枡鏁伴噺
public int GetTalentLockUseWashCount(HeroInfo hero)
{
- return washByLockUseCounts[hero.GetTalentLockCount()];
+ int heroTalentLockCount = hero.GetTalentLockCount();
+ //涓嶅鍙栨渶鍚庝竴涓�
+ if (heroTalentLockCount >= washByLockUseCounts.Length)
+ {
+ heroTalentLockCount = washByLockUseCounts.Length - 1;
+ }
+ return washByLockUseCounts[heroTalentLockCount];
}
@@ -53,7 +87,7 @@
- //鏄熶笂闄愮敱鍝佽川 鍜� 瑙夐啋鍐冲畾
+ //鏄熸渶缁堜笂闄愮敱鍝佽川 鍜� 瑙夐啋鍐冲畾
public int GetMaxStarCount(int heroID, int quality)
{
if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
@@ -70,9 +104,11 @@
}
return HeroQualityConfig.Get(quality).InitStarUpper + addStarCount;
}
-
- public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero)
+
+
+ //beforeGiftIDList鐢ㄤ簬瀵规瘮鍙樺寲鐨勫ぉ璧嬫牸瀛�
+ public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList = null, List<int> beforeGiftLevelList = null)
{
int showCount = GetGiftGirdMaxCount(hero.heroId);
for (int i = 0; i < giftBaseCells.Length; i++)
@@ -88,23 +124,114 @@
{
int giftID = hero.talentIDList[i];
int giftLV = hero.talentLvList[i];
- giftBaseCells[i].Init(giftID, giftLV);
+ int state = 0; //0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
+
+ if (!beforeGiftIDList.IsNullOrEmpty())
+ {
+ if (i >= beforeGiftIDList.Count)
+ {
+ state = 1;
+ }
+ else
+ {
+ if (giftID != beforeGiftIDList[i])
+ {
+ state = 1;
+ }
+ else
+ {
+ if (giftLV > beforeGiftLevelList[i])
+ {
+ state = 2;
+ }
+ }
+ }
+ }
+
+ giftBaseCells[i].Init(giftID, giftLV, state, hero.heroId, i, hero.awakeLevel);
}
else
{
+ if (!beforeGiftIDList.IsNullOrEmpty())
+ {
+ //瀵规瘮鎯呭喌涓嬩笉鏄剧ず
+ giftBaseCells[i].SetActive(false);
+ continue;
+ }
+
+ //闈炲姣旂殑鏄剧ず
if (i < normalGiftMaxCnt)
{
giftBaseCells[i].Init(0, 0);
}
else
{
- int index = i;
- giftBaseCells[i].Init(-1, 0, null, hero.heroId, index);
+ giftBaseCells[i].Init(-1, 0, 0, hero.heroId, i);
}
}
}
}
+
+ public void CacheHeroEatList()
+ {
+ heroEatList = PackManager.Instance.GetSinglePack(PackType.Hero).GetItemGUIDListById(
+ HeroManager.Instance.GetHero(selectHeroGuidForGiftFunc).heroId);
+ heroEatList.Remove(selectHeroGuidForGiftFunc); //鎺掗櫎鍚炲櫖涓讳綋
+ heroEatList.Sort(CmpDeleteHero);
+ }
+
+
+
+
+ public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true)
+ {
+ int imgCount = starImages.Length;
+ for (int i = 0; i < imgCount; i++)
+ {
+ if (starCount == 0 && i == 0)
+ {
+ if (noStarShow)
+ {
+ // 鏃犳槦绾� 鐗规畩澶勭悊 鏄剧ず涓�涓┖鏄熸槦
+ starImages[i].SetActive(true);
+ starImages[i].SetSprite("herostar" + starCount);
+ }
+ else
+ {
+ starImages[i].SetActive(false);
+ }
+ }
+ else if ((starCount - 1) % imgCount >= i)
+ {
+ starImages[i].SetActive(true);
+ starImages[i].SetSprite("herostar" + (((starCount - 1) / imgCount) + 1) * imgCount);
+ }
+ else
+ {
+ starImages[i].SetActive(false);
+ }
+ }
+ }
+
+
+ // public ushort ItemIndex; //姝﹀皢鐗╁搧鎵�鍦ㄦ灏嗚儗鍖呬綅缃储寮�
+ // public byte LockCnt;
+ // public byte[] LockTalentIndexs; //閿佸畾澶╄祴绱㈠紩鍒楄〃
+ // public byte OPType; // 鎿嶄綔绫诲瀷锛�0-鎵ц娲楃偧锛�1-鏇挎崲鍘熷ぉ璧嬶紱2-淇濈暀鍘熷ぉ璧�
+ public void SendWash(HeroInfo hero, byte opType)
+ {
+ var pack = new CB235_tagCSHeroWash();
+ pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+ pack.LockCnt = (byte)hero.talentLockList.Count;
+ pack.LockTalentIndexs = new byte[pack.LockCnt];
+ for (int i = 0; i < pack.LockCnt; i++)
+ {
+ pack.LockTalentIndexs[i] = (byte)hero.talentLockList[i];
+ }
+ pack.OPType = opType;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
}
--
Gitblit v1.8.0