From c3525dadcaa037816b654a6bb706284bbbf51af3 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 11 九月 2025 17:50:22 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/KnapSack/PackManager.cs | 3
Main/Utility/EnumHelper.cs | 8
Main/System/HeroUI/HeroCollectionLvUpWin.cs | 13
Main/Component/UI/Core/ButtonEx.cs | 4
Main/System/OfficialRank/OfficialUpWin.cs | 18 +-
Main/System/HeroUI/HeroCardCell.cs | 18 +
Main/System/MainLevel/MainBossEnterWin.cs | 4
Main/System/HappyXB/HappyXBModel.cs | 6
Main/System/HeroUI/HeroBestWin.cs | 2
Main/System/OfficialRank/OfficialTitleCell.cs | 12 +
Main/System/HeroUI/HeroUIManager.Collect.cs | 4
Main/System/Hero/HeroInfo.cs | 10 -
Main/System/Hero/HeroManager.cs | 7
Main/System/OfficialRank/OfficialUpCell.cs | 2
Main/Config/Configs/ItemConfig.cs | 2
Main/System/KnapSack/New/CommonItemBaisc.cs | 7
Main/System/Team/TeamBase.cs | 12 +
Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0418_tagObjInfoRefresh.cs | 1
Main/System/HeroUI/HeroTrainWin.cs | 72 ++++++++
Main/System/HeroUI/HeroUIManager.cs | 222 ++++++++++++++++++++++++++-
20 files changed, 357 insertions(+), 70 deletions(-)
diff --git a/Main/Component/UI/Core/ButtonEx.cs b/Main/Component/UI/Core/ButtonEx.cs
index 87d4365..7342ebf 100644
--- a/Main/Component/UI/Core/ButtonEx.cs
+++ b/Main/Component/UI/Core/ButtonEx.cs
@@ -52,6 +52,10 @@
public override void OnPointerDown(PointerEventData eventData)
{
+ if (this.interactable == false)
+ {
+ return;
+ }
base.OnPointerDown(eventData);
transform.localScale = originalScale * pressedScale;
}
diff --git a/Main/Config/Configs/ItemConfig.cs b/Main/Config/Configs/ItemConfig.cs
index c5716e9..188f823 100644
--- a/Main/Config/Configs/ItemConfig.cs
+++ b/Main/Config/Configs/ItemConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: Wednesday, September 10, 2025
//--------------------------------------------------------
using System.Collections.Generic;
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0418_tagObjInfoRefresh.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0418_tagObjInfoRefresh.cs
index f93f21b..21af3f4 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0418_tagObjInfoRefresh.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0418_tagObjInfoRefresh.cs
@@ -1,6 +1,5 @@
using UnityEngine;
using System.Collections;
-using static UnityEditor.Experimental.GraphView.GraphView;
//04 18 鍛ㄥ洿瀵硅薄鍒锋柊#tagObjInfoRefresh
diff --git a/Main/System/HappyXB/HappyXBModel.cs b/Main/System/HappyXB/HappyXBModel.cs
index 6050fbf..7d072a4 100644
--- a/Main/System/HappyXB/HappyXBModel.cs
+++ b/Main/System/HappyXB/HappyXBModel.cs
@@ -592,7 +592,11 @@
//鑻遍泟鎷涘嫙
public void HeroCallRedPoint()
{
- if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure)) return;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure))
+ return;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
+ return;
+
// 鍏嶈垂 10杩� 绉垎
bestXB10Red.state = RedPointState.None;
bestXBFreeRed.state = RedPointState.None;
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index f22f394..e0b9657 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -41,15 +41,7 @@
return itemHero.GetUseDataFirstValue(70);
}
}
- // 浼樺厛鍔熻兘鎻愰啋绫诲瀷锛�1瑙夐啋 2鍗囩骇 3绐佺牬 4鍗囨槦
- // 浼樺厛椤哄簭锛�
- public int funcState
- {
- get
- {
- return 0;
- }
- }
+
public bool isLock
{
diff --git a/Main/System/Hero/HeroManager.cs b/Main/System/Hero/HeroManager.cs
index e64402f..28036d5 100644
--- a/Main/System/Hero/HeroManager.cs
+++ b/Main/System/Hero/HeroManager.cs
@@ -10,13 +10,6 @@
//鍒濆鍒涘缓锛�0725锛夛紝鍚庣画璺熼殢鑳屽寘浜嬩欢澧炲姞鍒犻櫎 key = guid
protected Dictionary<string, HeroInfo> heroInfoDict = new Dictionary<string, HeroInfo>();
-
-
- //姝﹀皢绾㈢偣
- //MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
-
- public Action<HeroInfo> onNewHeroEvent;
-
public Action<HeroInfo> onHeroChangeEvent;
public Action<int> onHeroDeleteEvent;
diff --git a/Main/System/HeroUI/HeroBestWin.cs b/Main/System/HeroUI/HeroBestWin.cs
index dcef983..a66f9c0 100644
--- a/Main/System/HeroUI/HeroBestWin.cs
+++ b/Main/System/HeroUI/HeroBestWin.cs
@@ -235,7 +235,7 @@
}
countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
awakeLevel = HeroAwakeConfig.GetMaxAwakeLV(HeroUIManager.Instance.selectForPreviewHeroID);
- heroLevel = HeroUIManager.Instance.GetMaxLVByBreakLV(heroConfig.Quality, breakLevel);
+ heroLevel = HeroUIManager.Instance.GetMaxLV(heroConfig.Quality);
if (awakeLevel == 0)
{
awakeLVText.text = Language.Get("L1094") + heroLevel;
diff --git a/Main/System/HeroUI/HeroCardCell.cs b/Main/System/HeroUI/HeroCardCell.cs
index dac5741..0f5d634 100644
--- a/Main/System/HeroUI/HeroCardCell.cs
+++ b/Main/System/HeroUI/HeroCardCell.cs
@@ -12,6 +12,7 @@
[SerializeField] UIHeroController heroModel;
[SerializeField] Image onStateImg;
[SerializeField] RedpointBehaviour redpoint;
+ [SerializeField] Image newImage; //鏂版爣璇嗗拰绾㈢偣浜掓枼
[SerializeField] Image trainStateImg;
[SerializeField] Text nameText;
[SerializeField] Image awakeImg;
@@ -38,12 +39,23 @@
heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
- redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
- var funcState = hero.funcState;
+ int teamPos = TeamManager.Instance.GetTeam(TeamType.Story).GetPosition(hero.itemHero.guid);
+ if (teamPos >= 0)
+ {
+ redpoint.redpointId = MainRedDot.HeroCardRedpoint * 10 + teamPos;
+ newImage.SetActive(false);
+ }
+ else
+ {
+ redpoint.redpointId = 0;
+ newImage.SetActive(HeroUIManager.Instance.newHeroIDList.Contains(hero.heroId));
+ }
+
+ var funcState = HeroUIManager.Instance.GetFuncState(hero);
if (funcState > 0)
{
trainStateImg.SetActive(true);
- trainStateImg.SetSprite("herofuncstate" + hero.funcState);
+ trainStateImg.SetSprite("herofuncstate" + funcState);
}
else
{
diff --git a/Main/System/HeroUI/HeroCollectionLvUpWin.cs b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
index e466ef3..490e8d8 100644
--- a/Main/System/HeroUI/HeroCollectionLvUpWin.cs
+++ b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
@@ -60,10 +60,10 @@
HB122_tagSCHeroInfo.tagSCHero colData;
HeroUIManager.Instance.TryGetHeroBookInfo(HeroUIManager.Instance.selectCollectHeroID, out colData);
var bookPer = HeroUIManager.Instance.GetHeroBookPer(HeroUIManager.Instance.selectCollectHeroID);
- if (state == 5)
+ if (state == 5 || state == 2)
{
//宸叉弧绾�
- titleText.text = Language.Get("HeroAwake13");
+ titleText.text = state == 5 ? Language.Get("HeroAwake13") : Language.Get("HeroAwake12");
fullPanel.SetActive(true);
lvupPanel.SetActive(false);
@@ -85,8 +85,9 @@
}
else
{
- fullImg.SetActive(true);
- btn.SetActive(false);
+ fullImg.SetActive(state == 5);
+ btn.SetActive(state == 2);
+ btnText.text = Language.Get("L1109");
}
}
@@ -111,8 +112,8 @@
//婵�娲�
addPer = qualityConfig.BookInitAddPer;
btnText.text = Language.Get("L1131"); //L1131 婵�娲�
- awardInfo.text = Language.Get("HeroAwake10", UIHelper.GetIconNameWithMoneyType(HeroUIManager.Instance.bookMoneyType),
- HeroUIManager.Instance.bookMoneyValue);
+ awardInfo.text = Language.Get("HeroAwake10", UIHelper.GetIconNameWithMoneyType(qualityConfig.BookActAwardMoney[0]),
+ qualityConfig.BookActAwardMoney[1]);
unActiveGo.SetActive(true);
titleText.text = Language.Get("HeroAwake11");
}
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index d361c38..c30e444 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -88,6 +88,11 @@
[SerializeField] Text freezeAawkeLVText;
[SerializeField] List<Image> starImgFreezeList;
+ //浼孩鐐圭敤鍥剧墖浠f浛
+ [SerializeField] Image redpointAwake;
+ [SerializeField] Image redpointGift;
+ [SerializeField] Image redpointLVUP;
+
string guid;
HeroInfo hero;
@@ -168,7 +173,7 @@
awakeCellList = new List<GameObject>();
freezeTipBtn.AddListener(() =>
- {
+ {
freezeTipGo.SetActive(!freezeTipGo.activeSelf);
});
}
@@ -242,6 +247,9 @@
RefreshGift();
RefreshAwake();
RefreshFreeze();
+ RefreshRedImg();
+
+ HeroUIManager.Instance.RemoveNewHero(hero.heroId);
}
void RefreshItemLockEvent(PackType type, string guid, bool lockState)
@@ -333,7 +341,7 @@
{
RefreshStars();
nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
-
+
nameText.color = UIHelper.GetUIColorByFunc(hero.Quality);
if (hero.Quality >= 4)
@@ -713,7 +721,65 @@
{
freezeTipBtn.SetActive(false);
}
-
+
freezeTipGo.SetActive(false);
}
+
+ void RefreshRedImg()
+ {
+ redpointAwake.SetActive(false);
+ redpointGift.SetActive(false);
+ redpointLVUP.SetActive(false);
+ if (!hero.IsInTeamByTeamType(TeamType.Story))
+ {
+ return;
+ }
+
+
+ var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId);
+ var itemPack = PackManager.Instance.GetSinglePack(PackType.Item);
+
+ //5鏄熷悗鎵嶈兘瑙夐啋
+ if (hero.heroStar >= HeroUIManager.Instance.starLevelCanAwake)
+ {
+ //鍒ゆ柇瑙夐啋鏉愭枡鏄惁瓒冲
+ var maxAwakeLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId);
+ if (hero.awakeLevel < maxAwakeLV)
+ {
+ var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel);
+ if (itemPack.GetCountById(config.UPCostItem[0]) >= config.UPCostItem[1])
+ {
+ redpointAwake.SetActive(true);
+ }
+ }
+ }
+
+ if (heroCnt > 1)
+ {
+ redpointGift.SetActive(true);
+ }
+
+ var maxBreakLV = HeroBreakConfig.GetMaxBreakLv(hero.heroId);
+ if (hero.breakLevel < maxBreakLV)
+ {
+ if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero))
+ {
+ var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel);
+ if (itemPack.GetCountById(breakConfig.UPCostItem[0]) >= breakConfig.UPCostItem[1])
+ {
+ redpointLVUP.SetActive(true);
+ return;
+ }
+ }
+ }
+
+ if (!HeroUIManager.Instance.IsLVMax(hero))
+ {
+ var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
+ if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1])
+ {
+ redpointLVUP.SetActive(true);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroUIManager.Collect.cs b/Main/System/HeroUI/HeroUIManager.Collect.cs
index c51be67..fc12286 100644
--- a/Main/System/HeroUI/HeroUIManager.Collect.cs
+++ b/Main/System/HeroUI/HeroUIManager.Collect.cs
@@ -16,9 +16,6 @@
public int selectHeroCollectListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
public int selectCollectHeroID; //閫変腑鐨勬灏唅d 鐢ㄤ簬鍗囩骇
- public int bookMoneyType; //鍥鹃壌濂栧姳璐у竵绫诲瀷
- public int bookMoneyValue;//鍥鹃壌濂栧姳璐у竵鏁伴噺
-
public int selectForPreviewHeroID; //閫変腑鐨勬灏唅d 鐢ㄤ簬棰勮
//鍥鹃壌鍜岀毊鑲ょ殑婵�娲绘儏鍐�
@@ -35,6 +32,7 @@
}
allHeroBookPer = GetHeroCollectBookPer();
OnHeroCollectEvent?.Invoke();
+ UpdateHeroBookRedpoint();
}
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index aa04270..9a0dabc 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -1,6 +1,8 @@
锘縰sing System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
+using Jace.Operations;
using LitJson;
using UnityEngine;
@@ -13,25 +15,36 @@
public int selectHeroListJob = 0; //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
public int selectHeroListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
public string selectHeroGuid; //閫変腑鐨勬灏唅d
+ public int[] heroRedpointItemList; //鏈夊奖鍝嶇孩鐐圭殑閬撳叿
#endregion
public WaitHeroFuncResponse waitResponse; //璇锋眰姝﹀皢鍔熻兘锛屼笌鏈嶅姟绔氦浜�
//鐢ㄤ簬闈炰笂闃垫灏嗘垬鍔涘彉鍖栨椂 姝﹀皢ID锛氫笂娆℃垬鍔�
//浣跨敤鏂规硶锛氬叾浠栧姛鑳界晫闈㈣缃鍊煎嵆鍙�
- public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>();
+ public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>();
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnLoginLoadOK;
HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
+ TeamManager.Instance.OnTeamChange += OnTeamChangeEvent;
ParseConfig();
+ InitHeroOnTeamRedpointList();
+ InitHeroBookRedpointList();
}
public override void Release()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnLoginLoadOK;
HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
+ TeamManager.Instance.OnTeamChange -= OnTeamChangeEvent;
}
void ParseConfig()
@@ -42,13 +55,11 @@
rebornFormula = config.Numerical3;
rebornPayBackPer = int.Parse(config.Numerical4);
deletePayBackPer = int.Parse(config.Numerical5);
-
+
ParseGiftConfig();
- config = FuncConfigConfig.Get("HeroBook");
- var arr = JsonMapper.ToObject<int[]>(config.Numerical1);
- bookMoneyType = arr[0];
- bookMoneyValue = arr[1];
+ config = FuncConfigConfig.Get("HeroRedpoint");
+ heroRedpointItemList = JsonMapper.ToObject<int[]>(config.Numerical1);
}
public void OnBeforePlayerDataInitialize()
@@ -58,13 +69,23 @@
awakeRebirthCnt = 0;
waitResponse = default;
heroCollectInfoDic.Clear();
+ newHeroIDList.Clear();
+ }
+
+
+ void OnLoginLoadOK()
+ {
+ UpdateHeroCardRedpoint();
}
private void OnHeroChangeEvent(HeroInfo hero)
{
if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
return;
+
WaitServerResponse(hero);
+
+ refreshRedPoint = true;
}
private void WaitServerResponse(HeroInfo hero)
@@ -98,7 +119,7 @@
{
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)
@@ -252,6 +273,7 @@
public int selectHeroCallListJob = 0; //绛涢�夎亴涓�
public int selectHeroCallListCountry = 0; //绛涢�夊浗瀹�
+ public List<int> newHeroIDList = new List<int>(); //鏂版灏嗗垪琛�
public bool IsNewHero(int heroID)
{
HB122_tagSCHeroInfo.tagSCHero bookInfo;
@@ -262,6 +284,7 @@
//鏇寸簿鍑嗙殑 闇�瑕佹瘮杈冩湰娆℃娊鐨勫悓姝﹀皢涓暟 鍜� 鑳屽寘閲屾湁鐨勪釜鏁板啀姣旇緝
if (HappyXBModel.Instance.GetCountInResult(heroID) >= HeroManager.Instance.GetHeroCountByID(heroID))
{
+ AddNewHero(heroID);
return true;
}
else
@@ -275,14 +298,34 @@
}
}
+ AddNewHero(heroID);
return true;
+ }
+
+ public void AddNewHero(int heroID)
+ {
+ if (newHeroIDList.Contains(heroID))
+ {
+ return;
+ }
+ newHeroIDList.Add(heroID);
+ }
+
+ public void RemoveNewHero(int heroID)
+ {
+ if (!newHeroIDList.Contains(heroID))
+ {
+ return;
+ }
+ newHeroIDList.Remove(heroID);
+ refreshRedPoint = true;
}
List<int> allHeroCallScoreList = new List<int>(); //绉垎鎷涘嫙鍒楄〃
public void SortHeroCallList()
{
if (allHeroCallScoreList.IsNullOrEmpty())
- {
+ {
allHeroCallScoreList = HappyXBModel.Instance.GetAllGridLibItemIDByType((int)HappXBTitle.HeroCallScore);
}
heroCallSortList = new List<int>();
@@ -319,13 +362,11 @@
HeroConfig heroA = HeroConfig.Get(idA);
HeroConfig heroB = HeroConfig.Get(idB);
-
// 鎺掑簭瑙勫垯锛氭灏嗗搧璐紴姝﹀皢ID
if (heroA.Quality != heroB.Quality)
{
return heroA.Quality > heroB.Quality ? -1 : 1;
}
-
return heroA.HeroID.CompareTo(heroB.HeroID);
}
@@ -333,6 +374,167 @@
#endregion
+ // 浼樺厛鍔熻兘鎻愰啋绫诲瀷锛�1瑙夐啋 2鍗囨槦 3绐佺牬 4鍗囩骇
+ // 涓荤嚎涓婇樀姝﹀皢鎵嶉渶瑕佹彁閱� 瑙夐啋锛炲崌鏄燂紴绐佺牬锛炲崌绾�
+ public int GetFuncState(HeroInfo hero)
+ {
+ if (!hero.IsInTeamByTeamType(TeamType.Story))
+ {
+ return 0;
+ }
+
+ var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId);
+ var itemPack = PackManager.Instance.GetSinglePack(PackType.Item);
+ //5鏄熷悗鎵嶈兘瑙夐啋
+ if (hero.heroStar < starLevelCanAwake)
+ {
+ if (heroCnt > 1) return 2;
+ }
+ else
+ {
+ //鍒ゆ柇瑙夐啋鏉愭枡鏄惁瓒冲
+ var maxAwakeLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId);
+ if (hero.awakeLevel < maxAwakeLV)
+ {
+ var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel);
+ if (itemPack.GetCountById(config.UPCostItem[0]) >= config.UPCostItem[1])
+ {
+ return 1;
+ }
+ }
+ }
+
+ if (heroCnt > 1) return 2;
+
+ var maxBreakLV = HeroBreakConfig.GetMaxBreakLv(hero.heroId);
+ if (hero.breakLevel < maxBreakLV)
+ {
+ if (IsLVMaxByBreakLevel(hero))
+ {
+ var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel);
+ if (itemPack.GetCountById(breakConfig.UPCostItem[0]) >= breakConfig.UPCostItem[1])
+ {
+ return 3;
+ }
+ }
+ }
+
+ if (!IsLVMax(hero))
+ {
+ var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
+ if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1])
+ {
+ return 4;
+ }
+ }
+ return 0;
+ }
+
+ #region 绾㈢偣
+
+ public bool refreshRedPoint = false;
+ List<Redpoint> heroOnTeamRedpointList = new List<Redpoint>(); //涓婇樀鐨勬灏嗙孩鐐�
+ List<Redpoint> heroBookRedpointList = new List<Redpoint>(); //鍥鹃壌鎵�鏈夋灏嗙孩鐐�
+
+ //鏂版爣璇嗙殑绾㈢偣 鎵�鏈夋灏嗙粺涓�涓�
+ Redpoint newMarkRedPoint = new Redpoint(MainRedDot.HeroCardRedpoint, MainRedDot.HeroCardRedpoint * 10 + 9);
+ void InitHeroOnTeamRedpointList()
+ {
+ heroOnTeamRedpointList.Clear();
+ for (int i = 0; i < TeamConst.MaxTeamHeroCount; i++)
+ {
+ heroOnTeamRedpointList.Add(new Redpoint(MainRedDot.HeroCardRedpoint, MainRedDot.HeroCardRedpoint * 10 + i));
+ }
+ }
+
+
+ //姝﹀皢鍗$殑绾㈢偣:鍙粰涓婇樀姝﹀皢鍒风孩鐐癸紙鍚柊鏍囪瘑锛夛紝闈炰笂闃垫灏嗙殑鏂板浘鏍囨寜鍥剧墖澶勭悊涓嶅綊绫讳负绾㈢偣
+ void UpdateHeroCardRedpoint()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
+ return;
+
+ var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ for (int i = 0; i < heroOnTeamRedpointList.Count; i++)
+ {
+ var redpoint = heroOnTeamRedpointList[i];
+ var teamHero = team.GetServerHeroByIndex(i);
+ if (teamHero != null)
+ {
+ var hero = HeroManager.Instance.GetHero(teamHero.guid);
+ if (hero != null)
+ {
+ if (GetFuncState(hero) > 0)
+ {
+ redpoint.state = RedPointState.Simple;
+ continue;
+ }
+ }
+ }
+
+ redpoint.state = RedPointState.None;
+ }
+
+ newMarkRedPoint.state = newHeroIDList.Count > 0 ? RedPointState.New : RedPointState.None;
+ }
+
+
+ void InitHeroBookRedpointList()
+ {
+ heroBookRedpointList.Clear();
+ foreach (var key in HeroConfig.GetKeys())
+ {
+ heroBookRedpointList.Add(new Redpoint(MainRedDot.HeroCardCollectRedpoint, MainRedDot.HeroCardCollectRedpoint * 10000000 + key));
+ }
+ }
+
+ void UpdateHeroBookRedpoint()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
+ return;
+
+ foreach (var redpoint in heroBookRedpointList)
+ {
+ var heroID = redpoint.id % 10000000;
+ var state = GetHeroBookState(heroID, HeroConfig.Get(heroID).Quality);
+ if (state == 1 || state == 3 || state == 4)
+ {
+ redpoint.state = RedPointState.Simple;
+ continue;
+ }
+ redpoint.state = RedPointState.None;
+ }
+ }
+
+
+ void OnSecondEvent()
+ {
+ if (refreshRedPoint)
+ {
+ UpdateHeroCardRedpoint();
+ refreshRedPoint = false;
+ }
+ }
+
+ void RefreshItemEvent(PackType packType, int index, int itemID)
+ {
+ if (packType != PackType.Item)
+ return;
+
+ if (heroRedpointItemList.Contains(itemID))
+ {
+ refreshRedPoint = true;
+ }
+ }
+
+ void OnTeamChangeEvent(TeamType teamType)
+ {
+ if (teamType == TeamType.Story)
+ {
+ refreshRedPoint = true;
+ }
+ }
+ #endregion
}
#region 绛夊緟鏈嶅姟绔搷搴�
diff --git a/Main/System/KnapSack/New/CommonItemBaisc.cs b/Main/System/KnapSack/New/CommonItemBaisc.cs
index 9ad3cf5..2a250f9 100644
--- a/Main/System/KnapSack/New/CommonItemBaisc.cs
+++ b/Main/System/KnapSack/New/CommonItemBaisc.cs
@@ -330,12 +330,11 @@
void DisPlayEffect(ItemConfig config)
{
+ if (itemBaseEffect == null)
+ return;
if (config.BaseEffectID == 0)
{
- if (itemBaseEffect != null)
- {
- itemBaseEffect.SetActive(false);
- }
+ itemBaseEffect.SetActive(false);
}
else
{
diff --git a/Main/System/KnapSack/PackManager.cs b/Main/System/KnapSack/PackManager.cs
index 39aaa30..d60e762 100644
--- a/Main/System/KnapSack/PackManager.cs
+++ b/Main/System/KnapSack/PackManager.cs
@@ -434,8 +434,9 @@
if (itemGUIDDict[guid].packType == type)
{
itemGUIDDict.Remove(guid);
- DeleteItemEvent?.Invoke(type, guid, itemID, index, clearType);
}
+ //鍙槸鑳屽寘杞Щ锛屼笉鍒犻櫎浣嗕篃瑕侀�氱煡
+ DeleteItemEvent?.Invoke(type, guid, itemID, index, clearType);
}
}
diff --git a/Main/System/MainLevel/MainBossEnterWin.cs b/Main/System/MainLevel/MainBossEnterWin.cs
index 0e68fcf..e07b2a7 100644
--- a/Main/System/MainLevel/MainBossEnterWin.cs
+++ b/Main/System/MainLevel/MainBossEnterWin.cs
@@ -107,9 +107,7 @@
var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
- fightBtn.interactable = canChallengeBoss;
- fightBtn.SetColorful(null, canChallengeBoss);
-
+ fightBtn.SetInteractable(canChallengeBoss);
for (int i = 0; i < passAwards.Length; i++)
{
diff --git a/Main/System/OfficialRank/OfficialTitleCell.cs b/Main/System/OfficialRank/OfficialTitleCell.cs
index cd3c3d2..3ff2f27 100644
--- a/Main/System/OfficialRank/OfficialTitleCell.cs
+++ b/Main/System/OfficialRank/OfficialTitleCell.cs
@@ -14,14 +14,14 @@
}
- Transform m_OfficialRankObj;
- private Transform officialRankObj
+ Image m_OfficialRankObj;
+ private Image officialRankObj
{
get
{
if (m_OfficialRankObj == null)
{
- m_OfficialRankObj = this.GetComponent<Transform>("OfficialTitleCell/offcialRank");
+ m_OfficialRankObj = this.GetComponent<Image>("OfficialTitleCell/offcialRank");
}
return m_OfficialRankObj;
}
@@ -97,8 +97,12 @@
if (titleID == 0)
{
officialRankObj.SetActive(true);
+ var config = RealmConfig.Get(offcialRank);
+ officialRankObj.SetSprite("OfficialRank" + offcialRank);
+
titleUIFrame.SetActive(false);
- officialRankText.text = RealmConfig.Get(offcialRank).Name;
+ officialRankText.text = config.Name;
+ officialRankText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality);
}
else
{
diff --git a/Main/System/OfficialRank/OfficialUpCell.cs b/Main/System/OfficialRank/OfficialUpCell.cs
index 9a2987b..c42ec99 100644
--- a/Main/System/OfficialRank/OfficialUpCell.cs
+++ b/Main/System/OfficialRank/OfficialUpCell.cs
@@ -14,6 +14,7 @@
[SerializeField] Image bgImg;
[SerializeField] Image finishImg;
[SerializeField] Image getAwardImg;
+ [SerializeField] GameObject getAwardEffect;
[SerializeField] Text taskName;
[SerializeField] Image taskProcess;
[SerializeField] Text taskProcessText;
@@ -29,6 +30,7 @@
stateImg.SetSprite("OfficialMisionState" + state);
finishImg.SetActive(state == 2);
getAwardImg.SetActive(state == 1);
+ getAwardEffect.SetActive(state == 1);
bgImg.SetSprite(state == 0 ? "OfficialMissionBG0" : "OfficialMissionBG1");
switch (config.TaskType)
{
diff --git a/Main/System/OfficialRank/OfficialUpWin.cs b/Main/System/OfficialRank/OfficialUpWin.cs
index 3582835..c7f5e65 100644
--- a/Main/System/OfficialRank/OfficialUpWin.cs
+++ b/Main/System/OfficialRank/OfficialUpWin.cs
@@ -106,15 +106,15 @@
missionCellArr[i].Display(ids[i]);
}
- for (int i = 0; i < missionCellArr.Length; i++)
- {
- if (OfficialRankManager.Instance.GetMissionAwardState(i + 1) != 1)
- {
- lvUpBtn.SetColorful(null, false);
- return;
- }
- }
- lvUpBtn.SetColorful(null, true);
+ // for (int i = 0; i < missionCellArr.Length; i++)
+ // {
+ // if (OfficialRankManager.Instance.GetMissionAwardState(i + 1) != 1)
+ // {
+ // lvUpBtn.SetColorful(null, false);
+ // return;
+ // }
+ // }
+ // lvUpBtn.SetColorful(null, true);
}
diff --git a/Main/System/Team/TeamBase.cs b/Main/System/Team/TeamBase.cs
index c782953..3d08780 100644
--- a/Main/System/Team/TeamBase.cs
+++ b/Main/System/Team/TeamBase.cs
@@ -295,6 +295,18 @@
return -1; // No empty position
}
+ public int GetPosition(string guid)
+ {
+ foreach (var hero in serverHeroes)
+ {
+ if (hero != null && hero.guid == guid)
+ {
+ return hero.positionNum;
+ }
+ }
+ return -1;
+ }
+
// 甯冮樀鎺ュ彛
private void SetTeamHero(int posNum, TeamHero hero)
{
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index f2c6882..8b7664c 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -818,14 +818,14 @@
//鍔熻兘寮�鍚檺鍒剁被鍨�
public enum FuncOpenEnum
{
- Strength = 1,//瑁呭寮哄寲
- Gem = 2,//瀹濈煶闀跺祵
- Wing = 3,//缈呰唨
+ Hero = 1,//姝﹀皢
+ Challenge = 2,//鎸戞垬
+ Official = 3,//鍐呮斂
Pet = 6,//鐏靛疇
Treasure = 7,//娉曞疂
Mounts = 8,//鍧愰獞
Rune = 9,//绗﹀嵃
- Realm = 12, //澧冪晫
+ Realm = 12, //澧冪晫 瀹樿亴
Fairy = 15,// 浠欑洘
FairyTask = 16,
GodWeapon = 20, //绁炲叺
--
Gitblit v1.8.0