From 9388a25ed33fe004b6e5e6e4730e4f67715d1864 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期五, 17 四月 2026 14:44:37 +0800
Subject: [PATCH] 492 武将登场 高级战令
---
Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs | 91 +++++
Main/System/HeroDebut/HeroDebutZhanLingWin.cs.meta | 11
Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs | 35 +
Main/System/HeroDebut/HeroDebutWin.cs | 4
Main/System/HeroDebut/HeroDebutZhanLingCell.cs.meta | 11
Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs.meta | 11
Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs | 87 ++++
Main/System/HeroDebut/HeroDebutCallWin.cs | 27 -
Main/System/HeroDebut/HeroDebutManager.cs | 407 ++++++++++++++++++++++
Main/System/HeroDebut/HeroDebutZhanLingCell.cs | 121 ++++++
Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs | 35 +
Main/System/HeroDebut/HeroDebutZhanLingWin.cs | 151 ++++++++
Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs.meta | 11
Main/System/BattlePass/BattlePassManager.cs | 19
Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs.meta | 11
Main/Config/Configs/ActHeroAppearConfig.cs | 29
Main/System/UIBase/UIJumpManager.cs | 2
Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs.meta | 11
18 files changed, 1,036 insertions(+), 38 deletions(-)
diff --git a/Main/Config/Configs/ActHeroAppearConfig.cs b/Main/Config/Configs/ActHeroAppearConfig.cs
index fb2450f..6fe770f 100644
--- a/Main/Config/Configs/ActHeroAppearConfig.cs
+++ b/Main/Config/Configs/ActHeroAppearConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Thursday, March 26, 2026
+// [ Date ]: Thursday, April 16, 2026
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,6 +20,7 @@
public int ActNum;
public int[] ActHeroIDList;
public int ActTreasureType;
+ public int ActZhanlingType;
public int StarGiftTempID;
public int[] SkinCTGIDList;
public int[] GiftCTGIDList;
@@ -59,15 +60,17 @@
int.TryParse(tables[3],out ActTreasureType);
- int.TryParse(tables[4],out StarGiftTempID);
+ int.TryParse(tables[4],out ActZhanlingType);
- if (tables[5].Contains("["))
+ int.TryParse(tables[5],out StarGiftTempID);
+
+ if (tables[6].Contains("["))
{
- SkinCTGIDList = JsonMapper.ToObject<int[]>(tables[5]);
+ SkinCTGIDList = JsonMapper.ToObject<int[]>(tables[6]);
}
else
{
- string[] SkinCTGIDListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] SkinCTGIDListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
SkinCTGIDList = new int[SkinCTGIDListStringArray.Length];
for (int i=0;i<SkinCTGIDListStringArray.Length;i++)
{
@@ -75,13 +78,13 @@
}
}
- if (tables[6].Contains("["))
+ if (tables[7].Contains("["))
{
- GiftCTGIDList = JsonMapper.ToObject<int[]>(tables[6]);
+ GiftCTGIDList = JsonMapper.ToObject<int[]>(tables[7]);
}
else
{
- string[] GiftCTGIDListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] GiftCTGIDListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
GiftCTGIDList = new int[GiftCTGIDListStringArray.Length];
for (int i=0;i<GiftCTGIDListStringArray.Length;i++)
{
@@ -89,15 +92,15 @@
}
}
- int.TryParse(tables[7],out GiftShopType);
+ int.TryParse(tables[8],out GiftShopType);
- int.TryParse(tables[8],out ExShopType);
+ int.TryParse(tables[9],out ExShopType);
- int.TryParse(tables[9],out ExShopCostItemID);
+ int.TryParse(tables[10],out ExShopCostItemID);
- int.TryParse(tables[10],out SignTempID);
+ int.TryParse(tables[11],out SignTempID);
- int.TryParse(tables[11],out BillTempID);
+ int.TryParse(tables[12],out BillTempID);
}
catch (Exception exception)
{
diff --git a/Main/System/BattlePass/BattlePassManager.cs b/Main/System/BattlePass/BattlePassManager.cs
index ead813c..d76d0eb 100644
--- a/Main/System/BattlePass/BattlePassManager.cs
+++ b/Main/System/BattlePass/BattlePassManager.cs
@@ -133,11 +133,17 @@
UpdateWeekRedPoint();
break;
}
+
+ }
+
+ if (HeroDebutManager.IsZhanLingType(type))
+ {
+ HeroDebutManager.Instance.UpdateRedpoint();
}
}
-
-
+
+
#endregion
//鏄惁鏈変换浣曞鍔卞彲浠ラ鍙�
public bool HasAnyAward(int type, int totalValue)
@@ -370,7 +376,14 @@
}
- return 0;
+
+ // 澶勭悊ZhanLing绫诲瀷锛堜粠HeroDebutManager鑾峰彇缂撳瓨鐨刏hanLingType鍒楄〃锛�
+ if (HeroDebutManager.IsZhanLingType(_type))
+ {
+ return HeroDebutManager.GetZhanLingValueByType(_type);
+ }
+
+ return 0;
}
}
diff --git a/Main/System/HeroDebut/HeroDebutCallWin.cs b/Main/System/HeroDebut/HeroDebutCallWin.cs
index a6051d5..637b9f3 100644
--- a/Main/System/HeroDebut/HeroDebutCallWin.cs
+++ b/Main/System/HeroDebut/HeroDebutCallWin.cs
@@ -44,6 +44,7 @@
[SerializeField] UIHeroController lhController;
[SerializeField] UIHeroController uiHeroController;
[SerializeField] HeroDebutCallBubbleCell[] bubbleCell;
+ [SerializeField] RichText richText;
[SerializeField] float modleSize = 1f;
HeroDebutManager manager => HeroDebutManager.Instance;
@@ -263,8 +264,10 @@
xbButton10.Display(config.ActTreasureType, 1);
resMoneyCallCntText.text = Language.Get("HeroDebut24", Mathf.Max(treasureSetConfig.DailyMaxCountMoney - xbTypeInfo.treasureCountTodayGold, 0));
- var needCount = GetNextXBCountForBigAward(treasureType);
- nextBigAwardCntText.text = Language.Get("HeroDebut08", needCount.ToString());
+ int buyState = manager.GetZhanLingBuyState();
+ bool isBuyPaidH = buyState == 2 || buyState == 3;
+ var needCount = manager.GetNextXBCountForBigAward(treasureType) - (isBuyPaidH ? manager.subVulue : 0);
+ nextBigAwardCntText.text = Language.Get("HeroDebut08", needCount <= 0 ? 1 : needCount);
heroQualityText.text = Language.Get($"heroCallQaulity{heroConfig.Quality}");
manager.SetheroQaulityColor(heroQualityText, heroConfig.Quality);
@@ -291,28 +294,14 @@
}
}
+ // 璐拱浜嗛珮绾ф垬浠わ紙鐜勭骇锛夋椂闅愯棌richText
+ richText.SetActive(!isBuyPaidH);
+
ShowTop3();
OnSecondEvent();
}
- public int GetNextXBCountForBigAward(int type)
- {
- XBTypeInfo typeInfo = HappyXBModel.Instance.GetXBInfoByType(type);
- if (typeInfo == null) return 0;
- var xbConfig = HappyXBModel.Instance.GetXBItemConfigByType(type);
- var luckList = xbConfig.LuckyItemRateInfo.Keys.ToList();
- luckList.Sort();
- for (int i = 0; i < luckList.Count; i++)
- {
- var luckyValue = typeInfo.luckValue;
- if (luckyValue < luckList[i])
- {
- return luckList[i] - luckyValue;
- }
- }
- return 0;
- }
void ShowTop3()
{
for (int i = 0; i < top3NameText.Length; i++)
diff --git a/Main/System/HeroDebut/HeroDebutManager.cs b/Main/System/HeroDebut/HeroDebutManager.cs
index 06c7a34..95fc70f 100644
--- a/Main/System/HeroDebut/HeroDebutManager.cs
+++ b/Main/System/HeroDebut/HeroDebutManager.cs
@@ -1,14 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Codice.Client.BaseCommands.Import;
using LitJson;
using UnityEngine;
public class HeroDebutManager : GameSystemManager<HeroDebutManager>, IOpenServerActivity
{
+ // 缂撳瓨鐨刏hanLingType鍒楄〃锛堜粠ActHeroAppearConfig鑾峰彇锛屽悗缁笉鍙橈級
+ private static List<int> zhanLingTypeList = null;
+
public int[] xbGridArr;
public Dictionary<int, int[][]> heroQaulityColor;
public int[][] seeArr;
+ public int subVulue;
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
@@ -28,8 +33,11 @@
xbGridArr = JsonMapper.ToObject<int[]>(config.Numerical1);
heroQaulityColor = ConfigParse.ParseIntArray2Dict(config.Numerical2);
seeArr = JsonMapper.ToObject<int[][]>(config.Numerical3);
+ subVulue = int.Parse(config.Numerical4);
InitRedPointId();
+
+ BattlePassManager.Instance.BattlePassDataUpdateEvent += OnBattlePassDataUpdate;
}
public void SetheroQaulityColor(GradientText text, int qaulity)
@@ -52,6 +60,8 @@
GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent;
HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
TimeMgr.Instance.OnDayEvent -= OnDayEvent;
+
+ BattlePassManager.Instance.BattlePassDataUpdateEvent -= OnBattlePassDataUpdate;
}
private void OnDayEvent()
@@ -124,8 +134,8 @@
{
if (type == operaType && state == 0)
{
- gameRecDict.Clear();
- isSendFirst = true;
+ gameRecDict.Clear();
+ isSendFirst = true;
onStateUpdate?.Invoke(activityID);
TryPopWin();
UpdateRedpoint();
@@ -297,12 +307,14 @@
public Redpoint starUpRedpoint;
public Redpoint shopRedpoint;
public Redpoint giftRedpoint;
+ public Redpoint zhanLingRedpoint;
public void InitRedPointId()
{
checkInRedpoint ??= new Redpoint(MainRedDot.HeroDebutRepoint, GetRedPointId(HeroDebutRedPointType.CheckIn));
starUpRedpoint ??= new Redpoint(MainRedDot.HeroDebutRepoint, GetRedPointId(HeroDebutRedPointType.StarUp));
shopRedpoint ??= new Redpoint(MainRedDot.HeroDebutRepoint, GetRedPointId(HeroDebutRedPointType.Shop));
giftRedpoint ??= new Redpoint(MainRedDot.HeroDebutRepoint, GetRedPointId(HeroDebutRedPointType.Gift));
+ zhanLingRedpoint ??= new Redpoint(MainRedDot.HeroDebutRepoint, GetRedPointId(HeroDebutRedPointType.ZhanLing));
}
public void UpdateRedpoint()
@@ -312,6 +324,7 @@
starUpRedpoint.state = RedPointState.None;
shopRedpoint.state = RedPointState.None;
giftRedpoint.state = RedPointState.None;
+ zhanLingRedpoint.state = RedPointState.None;
if (!IsHeroDebutOpen()) return;
@@ -334,6 +347,11 @@
if (HasGiftCanHave())//鐨囨潈绀煎寘
{
giftRedpoint.state = RedPointState.Simple;
+ }
+
+ if (HasZhanLingCanHave())//鎴樹护
+ {
+ zhanLingRedpoint.state = RedPointState.Simple;
}
}
#endregion
@@ -754,7 +772,43 @@
return config.ActHeroIDList[callHeroIndex];
}
+ public int GetLuckValueAward(int type)
+ {
+ XBTypeInfo typeInfo = HappyXBModel.Instance.GetXBInfoByType(type);
+ if (typeInfo == null) return 0;
+ var xbConfig = HappyXBModel.Instance.GetXBItemConfigByType(type);
+ var luckList = xbConfig.LuckyItemRateInfo.Keys.ToList();
+ luckList.Sort();
+ for (int i = 0; i < luckList.Count; i++)
+ {
+ var luckyValue = typeInfo.luckValue;
+ if (luckyValue < luckList[i])
+ {
+ return luckList[i];
+ }
+ }
+ return 0;
+ }
+
+ public int GetNextXBCountForBigAward(int type)
+ {
+ XBTypeInfo typeInfo = HappyXBModel.Instance.GetXBInfoByType(type);
+ if (typeInfo == null) return 0;
+
+ var xbConfig = HappyXBModel.Instance.GetXBItemConfigByType(type);
+ var luckList = xbConfig.LuckyItemRateInfo.Keys.ToList();
+ luckList.Sort();
+ for (int i = 0; i < luckList.Count; i++)
+ {
+ var luckyValue = typeInfo.luckValue;
+ if (luckyValue < luckList[i])
+ {
+ return luckList[i] - luckyValue;
+ }
+ }
+ return 0;
+ }
#endregion
#region 鏃惰鐗瑰崠
@@ -931,6 +985,354 @@
#endregion
+ #region 鎴樹护
+ /// <summary>
+ /// 姝﹀皢鐧诲満鎴樹护绫诲瀷锛堜粠閰嶇疆瀹炴椂鑾峰彇锛�
+ /// </summary>
+ public int ZhanLingType => GetCurrentZhanLingType();
+
+ /// <summary>
+ /// 鑾峰彇褰撳墠鎴樹护绫诲瀷
+ /// </summary>
+ private int GetCurrentZhanLingType()
+ {
+ var act = GetOperationHeroAppearInfo();
+ if (act == null)
+ return 0;
+
+ var config = ActHeroAppearConfig.Get(act.CfgID);
+ return config?.ActZhanlingType ?? 0;
+ }
+
+ /// <summary>
+ /// 姝﹀皢鐧诲満鎴樹护鍔熻兘ID
+ /// </summary>
+ public const int ZhanLingFuncId = 63;
+
+ /// <summary>
+ /// 鎴樹护鏁版嵁鏇存柊浜嬩欢
+ /// </summary>
+ public event Action OnZhanLingUpdateEvent;
+
+ private void OnBattlePassDataUpdate(int type)
+ {
+ if (type == ZhanLingType)
+ {
+ OnZhanLingUpdateEvent?.Invoke();
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇姝﹀皢鐧诲満鎴樹护鐨勫綋鍓嶈繘搴﹀��
+ /// </summary>
+ public int GetZhanLingValue()
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ return data != null ? (int)data.value1 : 0;
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇鎸囧畾绫诲瀷鏄惁涓篫hanLing绫诲瀷锛堢紦瀛樻煡璇級
+ /// </summary>
+ public static bool IsZhanLingType(int type)
+ {
+ if (zhanLingTypeList == null)
+ {
+ zhanLingTypeList = ActHeroAppearConfig.GetValues()
+ .Select(x => x.ActZhanlingType)
+ .Where(x => x > 0)
+ .Distinct()
+ .ToList();
+ }
+ return zhanLingTypeList.Contains(type);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎸囧畾ZhanLing绫诲瀷鐨勮繘搴﹀��
+ /// </summary>
+ public static int GetZhanLingValueByType(int zhanLingType)
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(zhanLingType);
+ return data != null ? (int)data.value1 : 0;
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇姝﹀皢鐧诲満鎴樹护鐨勬寚瀹氱瓑绾ф槸鍚﹁揪鎴�
+ /// </summary>
+ public bool IsZhanLingNeedValueOk(int needValue)
+ {
+ return GetZhanLingValue() >= needValue;
+ }
+
+ /// <summary>
+ /// 鑾峰彇姝﹀皢鐧诲満鎴樹护鐨勮喘涔扮姸鎬�
+ /// 0 娌¤喘涔拌繘闃跺拰鐜勭骇 1 璐拱浜嗚繘闃舵病涔扮巹绾� 2 璐拱浜嗙巹绾ф病涔拌繘闃� 3 璐拱浜嗚繘闃跺拰鐜勭骇
+ /// </summary>
+ public int GetZhanLingBuyState()
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return 0;
+
+ bool isBuyPaid = data.isActivite > 0;
+ bool isBuyPaidH = data.isActiviteH > 0;
+ if (isBuyPaid && isBuyPaidH)
+ return 3;
+ if (isBuyPaid)
+ return 1;
+ if (isBuyPaidH)
+ return 2;
+ return 0;
+ }
+
+ /// <summary>
+ /// 鏄惁鏈夊彲棰嗗彇鐨勬垬浠ゅ鍔�
+ /// </summary>
+ public bool HasZhanLingCanHave()
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return false;
+
+ var dict = ZhanlingConfig.GetTypeToIDDict(ZhanLingType);
+ if (dict.IsNullOrEmpty())
+ return false;
+
+ int buyState = GetZhanLingBuyState();
+ bool isBuyPaid = buyState == 1 || buyState == 3;
+ bool isBuyPaidH = buyState == 2 || buyState == 3;
+
+ foreach (var kvp in dict)
+ {
+ int needValue = kvp.Key;
+ // 妫�鏌ュ厤璐瑰鍔�
+ int freeState = GetZhanLingFreeGiftState(needValue);
+ if (freeState == 1)
+ return true;
+
+ // 妫�鏌ユ櫘閫氬鍔憋紙闇�瑕佸凡璐拱杩涢樁锛�
+ if (isBuyPaid)
+ {
+ int paidState = GetZhanLingPaidGiftState(needValue);
+ if (paidState == 1)
+ return true;
+ }
+
+ // 妫�鏌ラ珮绾у鍔憋紙闇�瑕佸凡璐拱鐜勭骇锛�
+ if (isBuyPaidH)
+ {
+ int paidHState = GetZhanLingPaidGiftHState(needValue);
+ if (paidHState == 1)
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// 鑾峰彇姝﹀皢鐧诲満鎴樹护鍏嶈垂濂栧姳鐘舵��
+ /// 0 涓嶈兘棰� 1 鏈鍙� 2 宸查鍙�
+ /// </summary>
+ public int GetZhanLingFreeGiftState(int needValue)
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return 0;
+ var totalValue = BattlePassManager.Instance.GetTotalValue(ZhanLingType);
+ return BattlePassManager.Instance.GetBPCellAwardState(data, totalValue, needValue, 0);
+ }
+
+ /// <summary>
+ /// 鑾峰彇姝﹀皢鐧诲満鎴樹护鏅�氬鍔辩姸鎬�
+ /// 0 涓嶈兘棰� 1 鏈鍙� 2 宸查鍙�
+ /// </summary>
+ public int GetZhanLingPaidGiftState(int needValue)
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return 0;
+ var totalValue = BattlePassManager.Instance.GetTotalValue(ZhanLingType);
+ return BattlePassManager.Instance.GetBPCellAwardState(data, totalValue, needValue, 1);
+ }
+
+ /// <summary>
+ /// 鑾峰彇姝﹀皢鐧诲満鎴樹护楂樼骇濂栧姳鐘舵��
+ /// 0 涓嶈兘棰� 1 鏈鍙� 2 宸查鍙�
+ /// </summary>
+ public int GetZhanLingPaidGiftHState(int needValue)
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return 0;
+ var totalValue = BattlePassManager.Instance.GetTotalValue(ZhanLingType);
+ return BattlePassManager.Instance.GetBPCellAwardState(data, totalValue, needValue, 2);
+ }
+
+ /// <summary>
+ /// 涓�閿鍙栨灏嗙櫥鍦烘垬浠ゆ墍鏈夊彲棰嗗彇濂栧姳
+ /// </summary>
+ public void HaveAllZhanLingGift()
+ {
+ var data = BattlePassManager.Instance.GetBattlePassData(ZhanLingType);
+ if (data == null)
+ return;
+
+ if (PackManager.Instance.GetEmptyGridCount(PackType.Item) < 1)
+ {
+ SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580");
+ return;
+ }
+
+ var totalValue = BattlePassManager.Instance.GetTotalValue(ZhanLingType);
+ BattlePassManager.Instance.GetAllAward(data, ZhanLingType, totalValue);
+ }
+ #endregion
+
+ #region 鎴樹护棰勮璐拱
+ /// <summary>
+ /// 褰撳墠棰勮鐨勬垬浠ょ被鍨�
+ /// </summary>
+ public int previewZhanLingType { get; private set; }
+
+ /// <summary>
+ /// 褰撳墠棰勮鐨勭ぜ鍖呯被鍨� 1 鏅�氭垬浠ょぜ鍖� 2 楂樼骇鎴樹护绀煎寘
+ /// </summary>
+ public int previewGiftType { get; private set; }
+
+ /// <summary>
+ /// 鏄剧ず鎴樹护璐拱棰勮鐣岄潰
+ /// </summary>
+ public void ShowZhanLingHBuy(int zhanLingType, int showGiftType)
+ {
+ previewZhanLingType = zhanLingType;
+ previewGiftType = showGiftType;
+
+ if (showGiftType == 1)
+ {
+ UIManager.Instance.OpenWindow<HeroDebutZhanLingPreviewWin>();
+ }
+ else if (showGiftType == 2)
+ {
+ UIManager.Instance.OpenWindow<HeroDebutZhanLingPreviewHWin>();
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇褰撳墠棰勮绫诲瀷鐨勫厖鍊糏D
+ /// </summary>
+ public int GetPreviewCtgID()
+ {
+ int ctgid = 0;
+ if (previewGiftType == 1)
+ {
+ ctgid = BattlePassManager.Instance.GetCTGIDByType(previewZhanLingType);
+ }
+ else if (previewGiftType == 2)
+ {
+ // 楂樼骇鎴樹护浣跨敤 Numerical3
+ var config = FuncConfigConfig.Get("Zhanling");
+ if (config != null)
+ {
+ var dict = ConfigParse.ParseIntArrayDict(config.Numerical3);
+ if (dict.TryGetValue(previewZhanLingType, out var arr) && arr.Length > 0)
+ {
+ ctgid = arr[0];
+ }
+ }
+ }
+ return ctgid;
+ }
+
+ /// <summary>
+ /// 鑾峰彇璐拱鍚庢墍鏈夌瓑绾х殑濂栧姳
+ /// </summary>
+ /// <param name="maxCountPerSlot">姣忎釜鐩稿悓鐨刬temid姣忎釜鏍煎瓙鏈�澶у悓鏃舵樉绀虹殑鏁伴噺</param>
+ public List<Item> GetPreviewGiftAllItem(int maxCountPerSlot = 20)
+ {
+ List<int> collectList = new List<int>();
+ var dict = ZhanlingConfig.GetTypeToIDDict(previewZhanLingType);
+ if (dict.IsNullOrEmpty())
+ return new List<Item>();
+
+ var arr = dict.Keys.ToArray();
+ for (int i = 0; i < arr.Length; i++)
+ {
+ int needValue = arr[i];
+ int zhanLingId = dict[needValue];
+ collectList.Add(zhanLingId);
+ }
+ return CollectPreviewItems(collectList, maxCountPerSlot);
+ }
+
+ private List<Item> CollectPreviewItems(List<int> collectList, int maxCountPerSlot)
+ {
+ Dictionary<int, int> resultDict = new Dictionary<int, int>();
+ for (int i = 0; i < collectList.Count; i++)
+ {
+ int zhanLingId = collectList[i];
+ int[][] itemArr = GetPreviewItemArr(zhanLingId, previewGiftType);
+ if (itemArr.IsNullOrEmpty())
+ continue;
+
+ for (int j = 0; j < itemArr.Length; j++)
+ {
+ int itemID = itemArr[j][0];
+ int count = itemArr[j][1];
+ if (resultDict.ContainsKey(itemID))
+ resultDict[itemID] += count;
+ else
+ resultDict[itemID] = count;
+ }
+ }
+ List<Item> result = GetItemListByDict(resultDict, maxCountPerSlot);
+ result.Sort(CmpPreviewItem);
+ return result;
+ }
+
+ private int[][] GetPreviewItemArr(int zhanLingId, int showGiftType)
+ {
+ var config = ZhanlingConfig.Get(zhanLingId);
+ if (config == null)
+ return new int[][] { };
+
+ if (showGiftType == 1)
+ return config.ZLRewardItemList;
+ if (showGiftType == 2)
+ return config.ZLRewardItemListH;
+ return new int[][] { };
+ }
+
+ private List<Item> GetItemListByDict(Dictionary<int, int> dict, int maxCountPerSlot)
+ {
+ List<Item> result = new List<Item>();
+ var arr = dict.Keys.ToArray();
+ for (int i = 0; i < arr.Length; i++)
+ {
+ int itemID = arr[i];
+ int count = dict[itemID];
+
+ // 鏍规嵁maxCountPerSlot鎷嗗垎鏁伴噺锛屾瘡涓狪tem鏈�澶氭樉绀簃axCountPerSlot涓�
+ int slotCount = Mathf.CeilToInt((float)count / maxCountPerSlot);
+ for (int s = 0; s < slotCount; s++)
+ {
+ int itemCount = Mathf.Min(maxCountPerSlot, count - s * maxCountPerSlot);
+ result.Add(new Item(itemID, itemCount));
+ }
+ }
+ return result;
+ }
+
+ private int CmpPreviewItem(Item a, Item b)
+ {
+ int quality1 = ItemConfig.Get(a.id).ItemColor;
+ int quality2 = ItemConfig.Get(b.id).ItemColor;
+ if (quality1 != quality2)
+ return quality2.CompareTo(quality1);
+ return a.countEx.CompareTo(b.countEx);
+ }
+ #endregion
+
#region 鑾峰璁板綍
public static readonly int RecordType = 311;
@@ -1019,6 +1421,7 @@
StarUp = 2,
Shop = 3,
Gift = 4,
+ ZhanLing = 5,
}
public class HeroDebutGameRec
diff --git a/Main/System/HeroDebut/HeroDebutWin.cs b/Main/System/HeroDebut/HeroDebutWin.cs
index b91223f..06fe296 100644
--- a/Main/System/HeroDebut/HeroDebutWin.cs
+++ b/Main/System/HeroDebut/HeroDebutWin.cs
@@ -28,6 +28,8 @@
[SerializeField] UIHeroController lhController;
[SerializeField] Image callRedImage;
[SerializeField] ButtonEx closeButton;
+ [SerializeField] ButtonEx zhanlingBtn;
+ [SerializeField] RedpointBehaviour zhanlingRedpoint;
[SerializeField] float modleSize = 0.8f;
HeroDebutManager manager => HeroDebutManager.Instance;
protected override void InitComponent()
@@ -39,6 +41,7 @@
skinButton.SetListener(() => UIManager.Instance.OpenWindow<HeroDebutSkinWin>());
giftButton.SetListener(() => UIManager.Instance.OpenWindow<HeroDebutGiftWin>());
callButton.SetListener(() => UIManager.Instance.OpenWindow<HeroDebutCallWin>());
+ zhanlingBtn.SetListener(() => UIManager.Instance.OpenWindow<HeroDebutZhanLingWin>());
}
protected override void OnPreOpen()
@@ -76,6 +79,7 @@
starUpRedpoint.redpointId = manager.GetRedPointId(HeroDebutRedPointType.StarUp);
shopRedpoint.redpointId = manager.GetRedPointId(HeroDebutRedPointType.Shop);
giftRedpoint.redpointId = manager.GetRedPointId(HeroDebutRedPointType.Gift);
+ zhanlingRedpoint.redpointId = manager.GetRedPointId(HeroDebutRedPointType.ZhanLing);
}
private void Display()
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingCell.cs b/Main/System/HeroDebut/HeroDebutZhanLingCell.cs
new file mode 100644
index 0000000..233c51a
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingCell.cs
@@ -0,0 +1,121 @@
+锘縰sing System.Linq;
+using UnityEngine;
+
+public class HeroDebutZhanLingCell : CellView
+{
+ [SerializeField] ItemCell freeItemCell;
+ [SerializeField] Transform freeGotRect;
+ [SerializeField] Transform baseCanGetAwardRect;
+
+ [SerializeField] ItemCell[] paidAwards;
+ [SerializeField] Transform[] paidGotRects;
+ [SerializeField] Transform[] paidCanGetRects;
+ [SerializeField] Transform[] paidLockRects;
+ [SerializeField] ItemCell[] paidHAwards;
+ [SerializeField] Transform[] paidHGotRects;
+ [SerializeField] Transform[] paidHCanGetRects;
+ [SerializeField] Transform[] paidHLockRects;
+ [SerializeField] Transform upProcssBGRect;
+ [SerializeField] Transform upProcessRect;
+ [SerializeField] Transform downProcssBGRect;
+ [SerializeField] Transform downProcessRect;
+ [SerializeField] TextEx txtUnlockLV;
+ [SerializeField] Transform mask;
+
+ HeroDebutManager zhanLingModel => HeroDebutManager.Instance;
+
+ public void Display(int needValue)
+ {
+ var totalValue = BattlePassManager.Instance.GetTotalValue(zhanLingModel.ZhanLingType);
+ int zhanlingId = ZhanlingConfig.GetTypeToIDDict(zhanLingModel.ZhanLingType)[needValue];
+ int freeState = zhanLingModel.GetZhanLingFreeGiftState(needValue);
+ int paidState = zhanLingModel.GetZhanLingPaidGiftState(needValue);
+ int paidHState = zhanLingModel.GetZhanLingPaidGiftHState(needValue);
+ int buyState = zhanLingModel.GetZhanLingBuyState();
+
+ freeGotRect.SetActive(freeState == 2);
+ baseCanGetAwardRect.SetActive(freeState == 1);
+ mask.SetActive(freeState == 0);
+
+ for (int i = 0; i < paidAwards.Length; i++)
+ {
+ bool isBuy = buyState == 1 || buyState == 3;
+ paidGotRects[i].SetActive(paidState == 2);
+ paidCanGetRects[i].SetActive(paidState == 1 && isBuy);
+ paidLockRects[i].SetActive(!isBuy || paidState == 0);
+ }
+ for (int i = 0; i < paidHAwards.Length; i++)
+ {
+ bool isBuy = buyState == 2 || buyState == 3;
+ paidHGotRects[i].SetActive(paidHState == 2);
+ paidHCanGetRects[i].SetActive(paidHState == 1 && isBuy);
+ paidHLockRects[i].SetActive(!isBuy || paidHState == 0);
+ }
+ txtUnlockLV.text = needValue.ToString();
+
+ // 杩涘害鏉℃樉绀洪�昏緫
+ var ids = ZhanlingConfig.GetTypeToIDDict(zhanLingModel.ZhanLingType).Values.ToList();
+ ids.Sort();
+ upProcssBGRect.SetActive(ids[0] != zhanlingId);
+ upProcessRect.SetActive(freeState != 0);
+
+ downProcssBGRect.SetActive(ids[ids.Count - 1] != zhanlingId);
+ var nextConfig = ZhanlingConfig.Get(zhanlingId + 1);
+ downProcessRect.SetActive(nextConfig != null && totalValue >= nextConfig.NeedValue);
+
+ // 灞曠ずItemCell
+ var config = ZhanlingConfig.Get(zhanlingId);
+ if (config == null)
+ return;
+
+ // 鍏嶈垂濂栧姳
+ int freeItemId = config.FreeRewardItemList[0][0];
+ freeItemCell.Init(new ItemCellModel(freeItemId, false, config.FreeRewardItemList[0][1]));
+ freeItemCell.button.onClick.RemoveAllListeners();
+ freeItemCell.button.onClick.AddListener(() =>
+ {
+ if (freeState == 1)
+ zhanLingModel.HaveAllZhanLingGift();
+ else
+ ItemTipUtility.Show(freeItemId);
+ });
+
+ // 鏅�氬鍔�
+ for (int i = 0; i < paidAwards.Length; i++)
+ {
+ if (i >= config.ZLRewardItemList.Length)
+ continue;
+ int itemId2 = config.ZLRewardItemList[i][0];
+ paidAwards[i].Init(new ItemCellModel(itemId2, false, config.ZLRewardItemList[i][1]));
+ paidAwards[i].button.onClick.RemoveAllListeners();
+ paidAwards[i].button.onClick.AddListener(() =>
+ {
+ if (buyState == 0 || buyState == 2)
+ zhanLingModel.ShowZhanLingHBuy(zhanLingModel.ZhanLingType, 1);
+ else if (paidState == 1)
+ zhanLingModel.HaveAllZhanLingGift();
+ else
+ ItemTipUtility.Show(itemId2);
+ });
+ }
+
+ // 楂樼骇濂栧姳
+ for (int i = 0; i < paidHAwards.Length; i++)
+ {
+ if (i >= config.ZLRewardItemListH.Length)
+ continue;
+ int itemId3 = config.ZLRewardItemListH[i][0];
+ paidHAwards[i].Init(new ItemCellModel(itemId3, false, config.ZLRewardItemListH[i][1]));
+ paidHAwards[i].button.onClick.RemoveAllListeners();
+ paidHAwards[i].button.onClick.AddListener(() =>
+ {
+ if (buyState == 0 || buyState == 1)
+ zhanLingModel.ShowZhanLingHBuy(zhanLingModel.ZhanLingType, 2);
+ else if (paidHState == 1)
+ zhanLingModel.HaveAllZhanLingGift();
+ else
+ ItemTipUtility.Show(itemId3);
+ });
+ }
+ }
+}
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingCell.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingCell.cs.meta
new file mode 100644
index 0000000..f854cde
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 53ed1e831bb755c4085557d561217459
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs b/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs
new file mode 100644
index 0000000..0ab54c7
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections.Generic;
+
+public class HeroDebutZhanLingPreviewCell : CellView
+{
+ [SerializeField] ItemCell[] itemCells;
+ public const int itemCountPerRow = 5;
+
+ public void Display(int rowIndex, List<Item> items)
+ {
+ if (items == null)
+ return;
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ int index = rowIndex * itemCountPerRow + i;
+ if (index < items.Count)
+ {
+ itemCells[i].SetActive(true);
+ int itemID = items[index].id;
+ long count = items[index].countEx;
+ itemCells[i].Init(new ItemCellModel(itemID, false, count));
+ int clickItemId = itemID;
+ itemCells[i].button.AddListener(() =>
+ {
+ ItemTipUtility.Show(clickItemId);
+ });
+ }
+ else
+ {
+ itemCells[i].SetActive(false);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs.meta
new file mode 100644
index 0000000..5e0f025
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a3cd52709b8e8fc419ae3993e855cbab
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs
new file mode 100644
index 0000000..7a669b4
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections.Generic;
+
+public class HeroDebutZhanLingPreviewHCell : CellView
+{
+ [SerializeField] ItemCell[] itemCells;
+ public const int itemCountPerRow = 5;
+
+ public void Display(int rowIndex, List<Item> items)
+ {
+ if (items == null)
+ return;
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ int index = rowIndex * itemCountPerRow + i;
+ if (index < items.Count)
+ {
+ itemCells[i].SetActive(true);
+ int itemID = items[index].id;
+ long count = items[index].countEx;
+ itemCells[i].Init(new ItemCellModel(itemID, false, count));
+ int clickItemId = itemID;
+ itemCells[i].button.AddListener(() =>
+ {
+ ItemTipUtility.Show(clickItemId);
+ });
+ }
+ else
+ {
+ itemCells[i].SetActive(false);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs.meta
new file mode 100644
index 0000000..30408cf
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a426bf3edcc306240b4994629c254691
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs
new file mode 100644
index 0000000..157467d
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs
@@ -0,0 +1,91 @@
+using System;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class HeroDebutZhanLingPreviewHWin : UIBase
+{
+ [SerializeField] ScrollerController allScroller; //鎵�鏈夌瓑绾у鍔�
+ [SerializeField] Button btnClose;
+ [SerializeField] Button btnBuy;
+
+ [SerializeField] Text txtBuy;
+ [SerializeField] Text txtPercentage;
+ [SerializeField] Image imgMoney;
+ [SerializeField] Text txtMoney;
+
+ HeroDebutManager model => HeroDebutManager.Instance;
+ int ctgID;
+ int showCnt = 50;
+ protected override void InitComponent()
+ {
+ btnClose.AddListener(CloseWindow);
+ btnBuy.AddListener(OnBuyClick);
+ }
+
+ protected override void OnPreOpen()
+ {
+ allScroller.OnRefreshCell += OnScrollerRefreshAllCell;
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ allScroller.OnRefreshCell -= OnScrollerRefreshAllCell;
+
+ }
+
+ void OnBuyClick()
+ {
+ if (ctgID == 0)
+ {
+ CloseWindow();
+ return;
+ }
+ RechargeManager.Instance.CTG(ctgID);
+ CloseWindow();
+ }
+
+ protected override void NextFrameAfterOpen()
+ {
+ CreateAllScroller();
+ }
+
+ private void OnScrollerRefreshAllCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroDebutZhanLingPreviewHCell;
+ _cell.Display(_cell.index, model.GetPreviewGiftAllItem(showCnt));
+ }
+
+ void Display()
+ {
+ ctgID = model.GetPreviewCtgID();
+ var config = CTGConfig.Get(ctgID);
+ if (config == null)
+ {
+ CloseWindow();
+ return;
+ }
+ OrderInfoConfig orderCfg;
+ RechargeManager.Instance.TryGetOrderInfo(ctgID, out orderCfg);
+
+ txtPercentage.text = Language.Get("TimingGift02", config.Percentage);
+ txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderCfg.PayRMBNumOnSale));
+ imgMoney.SetIconWithMoneyType(config.MoneyType);
+ txtMoney.text = config.GainGold.ToString();
+ }
+
+ private void CreateAllScroller()
+ {
+ var items = model.GetPreviewGiftAllItem(showCnt);
+ if (items == null || items.Count == 0)
+ return;
+ int rowCount = (int)Math.Ceiling((double)items.Count / HeroDebutZhanLingPreviewCell.itemCountPerRow);
+ allScroller.Refresh();
+ for (int i = 0; i < rowCount; i++)
+ {
+ allScroller.AddCell(ScrollerDataType.Header, i);
+ }
+ allScroller.Restart();
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs.meta
new file mode 100644
index 0000000..1b101ef
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewHWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 954d7f3edfe26ed4c91e79c003c82484
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs b/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs
new file mode 100644
index 0000000..8863f57
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs
@@ -0,0 +1,87 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class HeroDebutZhanLingPreviewWin : UIBase
+{
+ [SerializeField] ScrollerController allScroller; //鎵�鏈夌瓑绾у鍔�
+ [SerializeField] Button btnClose;
+ [SerializeField] Button btnBuy;
+ [SerializeField] Text txtBuy;
+ [SerializeField] Text txtPercentage;
+ [SerializeField] Image imgMoney;
+ [SerializeField] Text txtMoney;
+ HeroDebutManager model => HeroDebutManager.Instance;
+ int ctgID;
+ int showCnt = 10;
+
+ protected override void OnPreOpen()
+ {
+ allScroller.OnRefreshCell += OnScrollerRefreshAllCell;
+ btnClose.AddListener(CloseWindow);
+ btnBuy.AddListener(OnBuyClick);
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ allScroller.OnRefreshCell -= OnScrollerRefreshAllCell;
+
+ }
+
+ void OnBuyClick()
+ {
+ if (ctgID == 0)
+ {
+ CloseWindow();
+ return;
+ }
+ RechargeManager.Instance.CTG(ctgID);
+ CloseWindow();
+ }
+
+ protected override void NextFrameAfterOpen()
+ {
+ CreateAllScroller();
+ }
+
+ private void OnScrollerRefreshAllCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroDebutZhanLingPreviewCell;
+ _cell.Display(_cell.index, model.GetPreviewGiftAllItem(showCnt));
+ }
+
+ void Display()
+ {
+ ctgID = model.GetPreviewCtgID();
+ var config = CTGConfig.Get(ctgID);
+ if (config == null)
+ {
+ CloseWindow();
+ return;
+ }
+ OrderInfoConfig orderCfg;
+ RechargeManager.Instance.TryGetOrderInfo(ctgID, out orderCfg);
+
+ txtPercentage.text = Language.Get("TimingGift02", config.Percentage);
+ txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderCfg.PayRMBNumOnSale));
+ imgMoney.SetIconWithMoneyType(config.MoneyType);
+ txtMoney.text = config.GainGold.ToString();
+ }
+
+ private void CreateAllScroller()
+ {
+ var items = model.GetPreviewGiftAllItem(showCnt);
+ if (items == null || items.Count == 0)
+ return;
+ int rowCount = (int)Math.Ceiling((double)items.Count / HeroDebutZhanLingPreviewCell.itemCountPerRow);
+ allScroller.Refresh();
+ for (int i = 0; i < rowCount; i++)
+ {
+ allScroller.AddCell(ScrollerDataType.Header, i);
+ }
+ allScroller.Restart();
+ }
+
+
+}
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs.meta
new file mode 100644
index 0000000..057192a
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingPreviewWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bef022f6fa7c2584bb050ca842bbe368
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingWin.cs b/Main/System/HeroDebut/HeroDebutZhanLingWin.cs
new file mode 100644
index 0000000..b140cfb
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingWin.cs
@@ -0,0 +1,151 @@
+锘縰sing System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+// 姝﹀皢鐧诲満鎴樹护
+public class HeroDebutZhanLingWin : UIBase
+{
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] ButtonEx btnGo;
+ [SerializeField] ButtonEx btnPaid;
+ [SerializeField] ButtonEx btnPaidH;
+
+ [SerializeField] ImageEx imgPaidLock;
+ [SerializeField] ImageEx imgPaidLockH;
+
+ [SerializeField] Text txtNowNeedValue;
+
+ [SerializeField] Text welfarePerText;
+ [SerializeField] Text itemNameText;
+ [SerializeField] Image adImg;
+ [SerializeField] Image adWordImg;
+ [SerializeField] Image adHeroImg;
+
+ [SerializeField] Text txtPaidLock;
+ [SerializeField] Text txtPaidLockH;
+ [SerializeField] Text txtPaidLockBuyed;
+ [SerializeField] Text txtPaidLockBuyedH;
+
+ HeroDebutManager zhanLingModel => HeroDebutManager.Instance;
+ protected override void InitComponent()
+ {
+ btnGo.AddListener(OnGoClick);
+ btnPaid.AddListener(OnPaidClick);
+ btnPaidH.AddListener(OnPaidHClick);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ zhanLingModel.OnZhanLingUpdateEvent += OnZhanLingUpdateEvent;
+ scroller.OnRefreshCell += OnScrollerRefreshCell;
+ ShowStaticUI();
+ Initialize();
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ zhanLingModel.OnZhanLingUpdateEvent -= OnZhanLingUpdateEvent;
+ scroller.OnRefreshCell -= OnScrollerRefreshCell;
+ }
+
+ private void Display()
+ {
+ //0 娌¤喘涔拌繘闃跺拰鐜勭骇 1 璐拱浜嗚繘闃舵病涔扮巹绾� 2 璐拱浜嗙巹绾ф病涔拌繘闃� 3 璐拱浜嗚繘闃跺拰鐜勭骇
+ int buyState = zhanLingModel.GetZhanLingBuyState();
+ scroller.m_Scorller.RefreshActiveCellViews();
+ txtNowNeedValue.text = Language.Get("HeroDebutZhanLing06", zhanLingModel.GetZhanLingValue());
+
+ // imgPaidLock: 鏈喘涔拌繘闃�(type 1)涓旀湭璐拱鐜勭骇(type 2)鏃舵樉绀洪攣锛屾垨宸茶喘涔扮巹绾т絾鏈喘涔拌繘闃舵椂鏄剧ず閿�
+ imgPaidLock.SetActive(buyState == 0 || buyState == 2);
+ // imgPaidLockH: 鏈喘涔扮巹绾т笖鏈喘涔拌繘闃舵椂鏄剧ず閿侊紝鎴栧凡璐拱杩涢樁浣嗘湭璐拱鐜勭骇鏃舵樉绀洪攣
+ imgPaidLockH.SetActive(buyState == 0 || buyState == 1);
+
+ txtPaidLock.SetActive(buyState == 0 || buyState == 2);
+ txtPaidLockBuyed.SetActive(buyState == 1 || buyState == 3);
+
+ txtPaidLockH.SetActive(buyState == 0 || buyState == 1);
+ txtPaidLockBuyedH.SetActive(buyState == 2 || buyState == 3);
+ }
+
+ private void OnZhanLingUpdateEvent()
+ {
+ Display();
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ private void OnScrollerRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroDebutZhanLingCell;
+ _cell.Display(_cell.index);
+ }
+
+ private void Initialize()
+ {
+ var cellList = ZhanlingConfig.GetTypeToIDDict(zhanLingModel.ZhanLingType).Keys.ToList();
+ scroller.Refresh();
+ for (int i = 0; i < cellList.Count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, cellList[i]);
+ }
+ scroller.Restart();
+
+ var data = BattlePassManager.Instance.GetBattlePassData(zhanLingModel.ZhanLingType);
+ var totalValue = BattlePassManager.Instance.GetTotalValue(zhanLingModel.ZhanLingType);
+ scroller.JumpIndex(BattlePassManager.Instance.JumpIndex(data, zhanLingModel.ZhanLingType, totalValue));
+ }
+
+
+
+ void ShowStaticUI()
+ {
+ // 鑾峰彇楂樼骇浠樿垂锛圥aidH/鐜勭骇锛夌殑CTGID鍜岀櫨鍒嗘瘮
+ var funcConfig = FuncConfigConfig.Get("Zhanling");
+ var dict = ConfigParse.ParseIntArrayDict(funcConfig.Numerical3);
+ if (dict.TryGetValue(zhanLingModel.ZhanLingType, out var arr) && arr.Length > 0)
+ {
+ var paidHConfig = CTGConfig.Get(arr[0]);
+ welfarePerText.text = paidHConfig.Percentage + "%";
+ }
+
+ adWordImg.SetSprite("BattlePassInWord" + zhanLingModel.ZhanLingType);
+ adImg.SetSprite("BattlePassInWord" + zhanLingModel.ZhanLingType);
+
+ var act = zhanLingModel.GetOperationHeroAppearInfo();
+ if (act == null) return;
+
+ var config = ActHeroAppearConfig.Get(act.CfgID);
+ if (config == null) return;
+ var needCount = zhanLingModel.GetLuckValueAward(config.ActTreasureType) - zhanLingModel.subVulue;
+ itemNameText.text = Language.Get("HeroDebutZhanLing01", needCount);
+
+ int heroID = zhanLingModel.GetCurrentDisplayCallHeroId();
+ adImg.SetSprite($"HeroDebutZhanLingBG_{heroID}");
+ adWordImg.SetSprite($"HeroDebutZhanLingWord_{heroID}");
+ adHeroImg.SetSprite($"HeroDebutZhanLingHero_{heroID}");
+ }
+
+ void OnGoClick()
+ {
+ UIJumpManager.Instance.OpenWindow(14);
+ }
+
+ void OnPaidClick()
+ {
+ int buyState = zhanLingModel.GetZhanLingBuyState();
+ // 宸茶喘涔拌繘闃�(type 1)鎴栧凡璐拱鐜勭骇鍜岃繘闃�(buyState == 3)鏃朵笉鍐嶈烦杞�
+ if (buyState == 1 || buyState == 3)
+ return;
+ zhanLingModel.ShowZhanLingHBuy(zhanLingModel.ZhanLingType, 1);
+ }
+
+ void OnPaidHClick()
+ {
+ int buyState = zhanLingModel.GetZhanLingBuyState();
+ // 宸茶喘涔扮巹绾�(type 2)鎴栧凡璐拱鐜勭骇鍜岃繘闃�(buyState == 3)鏃朵笉鍐嶈烦杞�
+ if (buyState == 2 || buyState == 3)
+ return;
+ zhanLingModel.ShowZhanLingHBuy(zhanLingModel.ZhanLingType, 2);
+ }
+}
diff --git a/Main/System/HeroDebut/HeroDebutZhanLingWin.cs.meta b/Main/System/HeroDebut/HeroDebutZhanLingWin.cs.meta
new file mode 100644
index 0000000..ff4bf78
--- /dev/null
+++ b/Main/System/HeroDebut/HeroDebutZhanLingWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8dd1ef3c24623734dbad0ca6cff2bd48
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/UIBase/UIJumpManager.cs b/Main/System/UIBase/UIJumpManager.cs
index 88b98a0..e7059a2 100644
--- a/Main/System/UIBase/UIJumpManager.cs
+++ b/Main/System/UIBase/UIJumpManager.cs
@@ -64,7 +64,7 @@
//姝﹀皢鐧诲満鐩稿叧
else if (config.WinName == "HeroDebutCallWin" || config.WinName == "HeroDebutSkinWin" ||
config.WinName == "HeroDebutCheckInWin" || config.WinName == "HeroDebutGiftWin" ||
- config.WinName == "HeroDebutShopWin")
+ config.WinName == "HeroDebutShopWin" || config.WinName == "HeroDebutZhanLingWin")
{
var heroDebutAct = HeroDebutManager.Instance.GetOperationHeroAppearInfo();
if (heroDebutAct == null)
--
Gitblit v1.8.0