From e3361e17ad1c56c2d94487dc092790258f328d74 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 11 二月 2026 17:07:24 +0800
Subject: [PATCH] 460 限时冲刺-界面 基础功能部分
---
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs | 14
Main/System/TimeRush/TimeRushGiftCell.cs.meta | 11
Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta | 11
Main/System/TimeRush/TimeRushTabCell.cs | 29
Main/Config/ConfigManager.cs | 3
Main/System/TimeRush/TimeRushTaskItem.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs | 12
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs | 79 ++
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta | 11
Main/System/Redpoint/MainRedDot.cs | 11
Main/System/TimeRush/TimeRushWin.cs | 294 +++++++++
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs | 25
Main/System/TimeRush/TimeRushTaskItem.cs | 42 +
Main/System/Main/HomeWin.cs | 27
Main/Main.cs | 1
Main/System/TimeRush/TimeRushManager.cs.meta | 11
Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta | 11
Main/System/TimeRush/TimeRushGiftCell.cs | 136 ++++
Main/Utility/EnumHelper.cs | 3
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta | 11
Main/System/TimeRush/TimeRushTaskCell.cs.meta | 11
Main/Config/Configs/ActLunhuidianTypeConfig.cs | 62 ++
Main/System/TimeRush/TimeRushTabCell.cs.meta | 11
Main/System/TimeRush/TimeRushManager.cs | 520 ++++++++++++++++
Main/System/TimeRush/TimeRushTaskCell.cs | 137 ++++
Main/System/TimeRush/OperationCycleHall.cs | 84 ++
Main/System/TimeRush/TimeRushCell.cs | 32 +
Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs | 54 +
Main/System/TimeRush/OperationCycleHall.cs.meta | 11
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta | 11
Main/System/OpenServerActivity/OperationTimeHepler.cs | 72 +-
Main/System/TimeRush.meta | 8
Main/System/TimeRush/TimeRushCell.cs.meta | 11
Main/System/TimeRush/TimeRushWin.cs.meta | 11
36 files changed, 1,758 insertions(+), 43 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 5950065..bab7e2c 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -38,6 +38,7 @@
// 鍔犺浇閰嶇疆鏂囦欢
HashSet<Type> configTypes = new HashSet<Type>() {
+ typeof(ActLunhuidianTypeConfig),
typeof(ADAwardConfig),
typeof(BattleMapConfig),
typeof(BeautyConfig),
@@ -258,6 +259,8 @@
public override void Release()
{
+ // 娓呯┖ ActLunhuidianTypeConfig 瀛楀吀
+ ClearConfigDictionary<ActLunhuidianTypeConfig>();
// 娓呯┖ ADAwardConfig 瀛楀吀
ClearConfigDictionary<ADAwardConfig>();
// 娓呯┖ BattleMapConfig 瀛楀吀
diff --git a/Main/Config/Configs/ActLunhuidianTypeConfig.cs b/Main/Config/Configs/ActLunhuidianTypeConfig.cs
new file mode 100644
index 0000000..e8041d1
--- /dev/null
+++ b/Main/Config/Configs/ActLunhuidianTypeConfig.cs
@@ -0,0 +1,62 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Wednesday, February 11, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ActLunhuidianTypeConfig : ConfigBase<int, ActLunhuidianTypeConfig>
+{
+ static ActLunhuidianTypeConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int ID;
+ public int RoundType;
+ public int TabType;
+ public int TabSort;
+ public string TabName;
+ public string bgImage;
+ public string TitleBgImage;
+ public string InfoBgImage;
+ public string InfoImage;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out ID);
+
+ int.TryParse(tables[1],out RoundType);
+
+ int.TryParse(tables[2],out TabType);
+
+ int.TryParse(tables[3],out TabSort);
+
+ TabName = tables[4];
+
+ bgImage = tables[5];
+
+ TitleBgImage = tables[6];
+
+ InfoBgImage = tables[7];
+
+ InfoImage = tables[8];
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta b/Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta
new file mode 100644
index 0000000..356ecea
--- /dev/null
+++ b/Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 68536606680071843968c757d340ca39
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs b/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs
new file mode 100644
index 0000000..f5d5803
--- /dev/null
+++ b/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs
@@ -0,0 +1,54 @@
+using System.Collections.Generic;
+using System.Linq;
+public partial class ActLunhuidianTypeConfig : ConfigBase<int, ActLunhuidianTypeConfig>
+{
+ static List<int> tabIndexList = new List<int>();
+ //<杞洖绫诲瀷,<鐣岄潰绫诲瀷,閰嶇疆ID>>
+ static Dictionary<int, Dictionary<int, int>> infoDict = new Dictionary<int, Dictionary<int, int>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ if (!infoDict.ContainsKey(RoundType))
+ infoDict[RoundType] = new Dictionary<int, int>();
+ infoDict[RoundType][TabType] = ID;
+ }
+
+ public static List<int> GetTabList()
+ {
+ if (tabIndexList.IsNullOrEmpty())
+ {
+ tabIndexList = GetKeys().OrderBy(id => Get(id)?.TabSort ?? int.MaxValue).ToList();
+ }
+ return tabIndexList;
+ }
+
+ public static int GetId(int roundType, int tabType)
+ {
+ return infoDict.TryGetValue(roundType, out var info) && info.TryGetValue(tabType, out var index) ? index : 0;
+ }
+
+ public static bool TryGetId(int roundType, int tabType, out int id)
+ {
+ id = 0;
+ return infoDict != null && infoDict.TryGetValue(roundType, out var info) && info.TryGetValue(tabType, out id);
+ }
+
+ public static bool TryGetConfig(int id, out ActLunhuidianTypeConfig config)
+ {
+ config = null;
+ if (!HasKey(id))
+ return false;
+ config = Get(id);
+ return true;
+ }
+
+ public static bool TryGetConfig(int roundType, int tabType, out ActLunhuidianTypeConfig config)
+ {
+ config = null;
+ if (!TryGetId(roundType, tabType, out int id))
+ return false;
+ return TryGetConfig(id, out config);
+ }
+
+
+}
diff --git a/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta b/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta
new file mode 100644
index 0000000..05e1b72
--- /dev/null
+++ b/Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2d2ecb0a241fb274ca3795554f869a1b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs
new file mode 100644
index 0000000..6cc5a65
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 88 杞洖娈挎椿鍔ㄤ俊鎭� #tagMCActLunhuidianInfo
+
+public class DTCAA88_tagMCActLunhuidianInfo : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HAA88_tagMCActLunhuidianInfo vNetData = vNetPack as HAA88_tagMCActLunhuidianInfo;
+ OperationTimeHepler.Instance.UpdateActLunhuidianInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta
new file mode 100644
index 0000000..adab3f9
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 449e1ce1e1ee26940a650a40f4b02770
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs
new file mode 100644
index 0000000..51dfa83
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 89 杞洖娈挎椿鍔ㄧ帺瀹朵俊鎭� #tagMCActLunhuidianPlayerInfo
+
+public class DTCAA89_tagMCActLunhuidianPlayerInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HAA89_tagMCActLunhuidianPlayerInfo vNetData = vNetPack as HAA89_tagMCActLunhuidianPlayerInfo;
+ TimeRushManager.Instance.UpdatePlayerInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta
new file mode 100644
index 0000000..834dd8b
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af4c2ff45746d0242b3debab8472b7e9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 1a85761..3639fae 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -151,6 +151,8 @@
Register(typeof(HA001_tagBroadCastInfo), typeof(DTCA001_tagBroadCastInfo));
Register(typeof(HA519_tagSCTagFamilyInfo), typeof(DTCA519_tagSCTagFamilyInfo));
Register(typeof(HA131_tagSCSettingDataInfo), typeof(DTCA131_tagSCSettingDataInfo));
+ Register(typeof(HAA88_tagMCActLunhuidianInfo), typeof(DTCAA88_tagMCActLunhuidianInfo));
+ Register(typeof(HAA89_tagMCActLunhuidianPlayerInfo), typeof(DTCAA89_tagMCActLunhuidianPlayerInfo));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs
new file mode 100644
index 0000000..c9cc063
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs
@@ -0,0 +1,79 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 88 杞洖娈挎椿鍔ㄤ俊鎭� #tagMCActLunhuidianInfo
+
+public class HAA88_tagMCActLunhuidianInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public string StartDate; // 寮�濮嬫棩鏈� y-m-d
+ public string EndtDate; // 缁撴潫鏃ユ湡 y-m-d
+ public byte ResetType; // 閲嶇疆绫诲瀷锛�0-0鐐归噸缃紱1-5鐐归噸缃�
+ public ushort LimitLV; // 闄愬埗绛夌骇
+ public byte RoundCount;
+ public tagMCActLunhuidianRound[] RoundList; // 杞洖鍒楄〃锛屾敮鎸佸涓笉鍚岀被鍨嬭疆鍥炲悓鏃跺紑鍚�
+
+ public HAA88_tagMCActLunhuidianInfo () {
+ _cmd = (ushort)0xAA88;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out ResetType, vBytes, NetDataType.BYTE);
+ TransBytes (out LimitLV, vBytes, NetDataType.WORD);
+ TransBytes (out RoundCount, vBytes, NetDataType.BYTE);
+ RoundList = new tagMCActLunhuidianRound[RoundCount];
+ for (int i = 0; i < RoundCount; i ++) {
+ RoundList[i] = new tagMCActLunhuidianRound();
+ TransBytes (out RoundList[i].RoundType, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundList[i].AwardType, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundList[i].AwardTypeValue, vBytes, NetDataType.DWORD);
+ TransBytes (out RoundList[i].RoundMax, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundList[i].AwardCount, vBytes, NetDataType.BYTE);
+ RoundList[i].AwardList = new tagMCActLunhuidianAward[RoundList[i].AwardCount];
+ for (int j = 0; j < RoundList[i].AwardCount; j ++) {
+ RoundList[i].AwardList[j] = new tagMCActLunhuidianAward();
+ TransBytes (out RoundList[i].AwardList[j].AwardIndex, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundList[i].AwardList[j].NeedValue, vBytes, NetDataType.DWORD);
+ TransBytes (out RoundList[i].AwardList[j].Count, vBytes, NetDataType.BYTE);
+ RoundList[i].AwardList[j].AwardItemList = new tagMCActLunhuidianItem[RoundList[i].AwardList[j].Count];
+ for (int k = 0; k < RoundList[i].AwardList[j].Count; k ++) {
+ RoundList[i].AwardList[j].AwardItemList[k] = new tagMCActLunhuidianItem();
+ TransBytes (out RoundList[i].AwardList[j].AwardItemList[k].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out RoundList[i].AwardList[j].AwardItemList[k].ItemCount, vBytes, NetDataType.WORD);
+ TransBytes (out RoundList[i].AwardList[j].AwardItemList[k].IsBind, vBytes, NetDataType.BYTE);
+ }
+ }
+ TransBytes (out RoundList[i].CTGIDCount, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundList[i].CTGIDList, vBytes, NetDataType.WORD, RoundList[i].CTGIDCount);
+ TransBytes (out RoundList[i].ShopType, vBytes, NetDataType.WORD);
+ }
+ }
+
+ public class tagMCActLunhuidianItem {
+ public uint ItemID;
+ public ushort ItemCount;
+ public byte IsBind;
+ }
+
+ public class tagMCActLunhuidianRound {
+ public byte RoundType; // 杞洖绫诲瀷
+ public byte AwardType; // 濂栧姳绫诲瀷 1-娑堣�楄揣甯侊紱2-瀵诲疂娆℃暟
+ public uint AwardTypeValue; // 濂栧姳绫诲瀷瀵瑰簲鍊硷紝娑堣�楄揣甯佹椂涓哄搴旂殑璐у竵绫诲瀷锛屽瀹濇椂涓哄搴旂殑瀵诲疂绫诲瀷
+ public byte RoundMax; // 鏈�澶у彲寰幆杞
+ public byte AwardCount;
+ public tagMCActLunhuidianAward[] AwardList; // 姣忚疆濂栧姳鍒楄〃
+ public byte CTGIDCount;
+ public ushort[] CTGIDList; // CTGID鍒楄〃
+ public ushort ShopType; // 寮�鏀惧晢搴楃被鍨嬶紝鍙兘涓�0涓嶅紑鏀�
+ }
+
+ public class tagMCActLunhuidianAward {
+ public byte AwardIndex; // 濂栧姳璁板綍绱㈠紩 0~30
+ public uint NeedValue; // 濂栧姳鎵�闇�鍊�
+ public byte Count; // 濂栧姳鐗╁搧鏁�
+ public tagMCActLunhuidianItem[] AwardItemList; // 濂栧姳鐗╁搧鍒楄〃
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta
new file mode 100644
index 0000000..d04150a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 43c3e23f4ddcc8c4f9a2e6ffd631b763
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs
new file mode 100644
index 0000000..da82b87
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 89 杞洖娈挎椿鍔ㄧ帺瀹朵俊鎭� #tagMCActLunhuidianPlayerInfo
+
+public class HAA89_tagMCActLunhuidianPlayerInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public byte RoundType; // 杞洖绫诲瀷
+ public byte CurRound; // 褰撳墠杞
+ public uint CurValue; // 绱鍊�
+ public uint AwardRecord; // 褰撳墠杞濂栧姳棰嗗璁板綍锛屾寜濂栧姳绱㈠紩浜岃繘鍒朵綅瀛樺偍鏄惁宸查鍙栵紝鎵�鏈夊鍔卞凡棰嗗彇鍚庤嚜鍔ㄨ繘鍏ヤ笅涓�杞紝涓旈噸缃濂栧姳鐘舵��
+
+ public HAA89_tagMCActLunhuidianPlayerInfo () {
+ _cmd = (ushort)0xAA89;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out RoundType, vBytes, NetDataType.BYTE);
+ TransBytes (out CurRound, vBytes, NetDataType.BYTE);
+ TransBytes (out CurValue, vBytes, NetDataType.DWORD);
+ TransBytes (out AwardRecord, vBytes, NetDataType.DWORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta
new file mode 100644
index 0000000..331b425
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4b06e47c41ad471429c77f4c82a23f08
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Main.cs b/Main/Main.cs
index 545afdf..8e019f4 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -106,6 +106,7 @@
managers.Add(GMNotifyManager.Instance);
managers.Add(TimingGiftManager.Instance);
managers.Add(SettingDataManager.Instance);
+ managers.Add(TimeRushManager.Instance);
foreach (var manager in managers)
{
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index dde90ca..b4927d7 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
@@ -67,6 +68,7 @@
[SerializeField] Button osHeroCallBtn;
[SerializeField] Button osGalaBtn;
[SerializeField] TimingGiftCell timingGiftCell;
+ [SerializeField] TimeRushCell timeRushCell;
//鍧愰獞
[SerializeField] Image horseBGImg;
@@ -269,13 +271,14 @@
ChatManager.Instance.OnUpdateTalkEvent += OnUpdateTalkEvent;
UIManager.Instance.OnOpenWindow += OnOpenWindow;
TimingGiftManager.Instance.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent;
+ OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
TryPlayAutoFightBoss();
Display();
DisplayFirstChargeBtn();
DisplayOSActivity();
timingGiftCell.InitUI();
- // var battleWin = UIManager.Instance.OpenWindow<BattleWin>();
- // battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
+
+ DisplayTimeRush();
DelayPlayMusic().Forget();
@@ -305,8 +308,14 @@
ChatManager.Instance.OnUpdateTalkEvent -= OnUpdateTalkEvent;
UIManager.Instance.OnOpenWindow -= OnOpenWindow;
TimingGiftManager.Instance.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent;
+ OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
// 鍏抽棴鐨勬椂鍊欐妸鎴樻枟鐣岄潰涔熺粰鍏充簡 铏界劧鏄湪澶栭潰寮�鐨�
UIManager.Instance.CloseWindow<BattleWin>();
+ }
+
+ private void OpenServerActivityStateChange()
+ {
+ DisplayTimeRush();
}
private void OnShowGiftIdListAddEvent()
@@ -793,6 +802,10 @@
{
timingGiftCell.InitUI();
}
+ else if (funcId == (int)FuncOpenEnum.TimeRush)
+ {
+ DisplayTimeRush();
+ }
}
private void OnUpdateFirstChargeInfo()
@@ -847,6 +860,16 @@
{
DisplayOSActivity();
}
+
+
+ void DisplayTimeRush()
+ {
+ bool isOpen = TimeRushManager.Instance.IsFuncOpen();
+ timeRushCell.SetActive(isOpen);
+ if (!isOpen)
+ return;
+ timeRushCell.InitUI();
+ }
}
diff --git a/Main/System/OpenServerActivity/OperationTimeHepler.cs b/Main/System/OpenServerActivity/OperationTimeHepler.cs
index e5b0b0c..6e75950 100644
--- a/Main/System/OpenServerActivity/OperationTimeHepler.cs
+++ b/Main/System/OpenServerActivity/OperationTimeHepler.cs
@@ -120,7 +120,7 @@
}
}
-
+
// /// <summary>
// /// 绱鍏呭��
@@ -195,7 +195,7 @@
// }
// }
-
+
// public void UpdateCollectWordsPackage(HAA40_tagMCActCollectWordsInfo package)
// {
@@ -304,7 +304,7 @@
// }
// }
-
+
// public void UpdateMultiRechargePackage(HAA27_tagMCActRechargePrizeInfo package)
// {
@@ -391,9 +391,9 @@
// }
// }
-
-
-
+
+
+
// public void UpdateCrossActLianQiInfo(HAA90_tagMCCrossActLianqiInfo package)
// {
@@ -432,34 +432,34 @@
// }
// }
- // public void UpdateActLunhuidianInfo(HAA88_tagMCActLunhuidianInfo package)
- // {
- // OperationBase operationBase = null;
- // operationDict.TryGetValue(Operation.default47, out operationBase);
- // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
- // {
- // ForceStopOperation(Operation.default47);
- // }
- // else
- // {
- // if (operationBase == null)
- // {
- // operationBase = new OperationCycleHall();
- // operationDict.Add(Operation.default47, operationBase);
- // }
- // OperationCycleHall operation = operationBase as OperationCycleHall;
- // operation.Reset();
- // operation.startDate = ParseOperationDate(package.StartDate);
- // operation.endDate = ParseOperationDate(package.EndtDate);
- // operation.resetType = package.ResetType;
- // operation.limitLv = package.LimitLV;
- // operation.ParseCycleHallInfo(package);
- // if (operationTimeUpdateEvent != null)
- // {
- // operationTimeUpdateEvent(Operation.default47);
- // }
- // }
- // }
+ public void UpdateActLunhuidianInfo(HAA88_tagMCActLunhuidianInfo package)
+ {
+ OperationBase operationBase = null;
+ operationDict.TryGetValue(OperationType.default47, out operationBase);
+ if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
+ {
+ ForceStopOperation(OperationType.default47);
+ }
+ else
+ {
+ if (operationBase == null)
+ {
+ operationBase = new OperationCycleHall();
+ operationDict.Add(OperationType.default47, operationBase);
+ }
+ OperationCycleHall operation = operationBase as OperationCycleHall;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.resetType = package.ResetType;
+ operation.limitLv = package.LimitLV;
+ operation.ParseCycleHallInfo(package);
+ if (operationTimeUpdateEvent != null)
+ {
+ operationTimeUpdateEvent(OperationType.default47);
+ }
+ }
+ }
// public void UpdateActYunShiInfo(HAA87_tagMCActYunshiInfo package)
// {
@@ -498,7 +498,7 @@
// }
// }
-
+
// public void UpdateLoginAct(HAA69_tagMCActLoginNew package)
// {
// OperationBase operationBase = null;
@@ -1048,6 +1048,8 @@
public enum OperationType
{
+
+
MultipleExp,
ConsumeRebate,
FlashSale,//闄愭椂鐗规儬
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index ab78e70..d612f4d 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -55,18 +55,18 @@
//鍘嗙粌绉樼瑘
public const int RedPoint_LLMJKey = 106;
-
+
//绛惧埌
public const int RedPoint_SignKey = 107;
//鍧愰獞
public const int RedPoint_HorseKey = 108;
Redpoint redPointHorse = new Redpoint(RedPoint_HorseKey);
-
+
//鐗规潈鍗�
public const int RedPoint_PrivilegeCard = 109;
Redpoint pcardRedpoint = new Redpoint(RedPoint_PrivilegeCard);
-
+
//鑷姩鎴樻枟
public const int RedPoint_AutoBattleKey = 110;
Redpoint autoBattleRedpoint = new Redpoint(RedPoint_AutoBattleKey);
@@ -112,7 +112,7 @@
#endregion
public const int BlessLVRedpoint = 399; //绁濈绛夌骇绾㈢偣
-
+
#region 浠欑洘绾㈢偣
//澶у巺
@@ -131,7 +131,7 @@
public const int LoginZhanLingRedpoint = 449; //鐧诲綍鎴樹护
public const int FairyEmbleManageRepoint = 462;//浠欑洘寰界珷绠$悊鍏ュ彛绾㈢偣
- public const int CycleHallRepoint = 463; //杞洖娈�
+
public const int YunShiRepoint = 464; //杩愬娍
public const int LianQiRepoint = 465; //浠欏尃澶т細
public const int FairySiegeRepoint = 466; //浠欑洘鏀诲煄鎴�
@@ -146,6 +146,7 @@
public const int HeroFatesRepoint = 475;//瀹跨紭
public const int DailyTehui = 476;//姣忔棩鐗规儬
public const int WarlordPavilionRepoint = 477;//瀹氬啗闃�
+ public const int TimeRushRepoint = 478; //杞洖娈�
public void Register()
{
diff --git a/Main/System/TimeRush.meta b/Main/System/TimeRush.meta
new file mode 100644
index 0000000..1e1154c
--- /dev/null
+++ b/Main/System/TimeRush.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7332dc3700298964f9961b3ca4da2c98
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/OperationCycleHall.cs b/Main/System/TimeRush/OperationCycleHall.cs
new file mode 100644
index 0000000..58dd12e
--- /dev/null
+++ b/Main/System/TimeRush/OperationCycleHall.cs
@@ -0,0 +1,84 @@
+锘縰sing System.Collections.Generic;
+
+
+//杞洖娈挎椿鍔�
+public class OperationCycleHall : OperationBase
+{
+ // <杞洖绫诲瀷, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound>
+ public Dictionary<int, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound> roundInfoDict = new Dictionary<int, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound>();
+ TimeRushManager model { get { return TimeRushManager.Instance; } }
+ public bool TryGetRound(int roundType, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound round)
+ {
+ round = null;
+ return roundInfoDict != null && roundInfoDict.TryGetValue(roundType, out round) && round != null;
+ }
+
+ public bool TryGetRoundInfoByIndex(int roundType, int awardIndex, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo, out int listIndex)
+ {
+ listIndex = 0;
+ awardInfo = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward { };
+ if (!TryGetRound(roundType, out var round) || round.AwardList == null)
+ return false;
+ for (int i = 0; i < round.AwardList.Length; i++)
+ {
+ if (round.AwardList[i].AwardIndex == awardIndex)
+ {
+ awardInfo = round.AwardList[i];
+ listIndex = i;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool TryGetRoundInfoByNeedValue(int roundType, int needValue, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo)
+ {
+ awardInfo = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward { };
+ if (!TryGetRound(roundType, out var round) || round.AwardList == null)
+ return false;
+ for (int i = 0; i < round.AwardList.Length; i++)
+ {
+ if (round.AwardList[i].NeedValue == needValue)
+ {
+ awardInfo = round.AwardList[i];
+ return true;
+ }
+ }
+ return true;
+ }
+
+ public override bool SatisfyOpenCondition()
+ {
+ return PlayerDatas.Instance.baseData.LV >= limitLv;
+ }
+
+ public override string ToDisplayTime()
+ {
+ var textBuilder = OperationTimeHepler.textBuilder;
+ textBuilder.Length = 0;
+ textBuilder.Append(startDate.ToDisplay());
+ if (startDate != endDate)
+ {
+ textBuilder.Append("鈥�");
+ textBuilder.Append(endDate.ToDisplay());
+ }
+ return textBuilder.ToString();
+ }
+
+ public override void Reset()
+ {
+ base.Reset();
+ roundInfoDict.Clear();
+ model.lastCurRoundDict.Clear();
+ model.lastCurValueDict.Clear();
+ }
+
+ public void ParseCycleHallInfo(HAA88_tagMCActLunhuidianInfo package)
+ {
+ roundInfoDict.Clear();
+ for (int i = 0; i < package.RoundList.Length; i++)
+ {
+ roundInfoDict[package.RoundList[i].RoundType] = package.RoundList[i];
+ }
+ }
+}
diff --git a/Main/System/TimeRush/OperationCycleHall.cs.meta b/Main/System/TimeRush/OperationCycleHall.cs.meta
new file mode 100644
index 0000000..e084fa5
--- /dev/null
+++ b/Main/System/TimeRush/OperationCycleHall.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0808e48a7e494424ab338530cfbc9c41
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushCell.cs b/Main/System/TimeRush/TimeRushCell.cs
new file mode 100644
index 0000000..af22af1
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushCell.cs
@@ -0,0 +1,32 @@
+using System.Linq;
+using UnityEngine;
+
+public class TimeRushCell : MonoBehaviour
+{
+ [SerializeField] ImageEx bgImage;
+ [SerializeField] TextEx titleText;
+ [SerializeField] ButtonEx iconButton;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+ public void InitUI()
+ {
+ var list = TimeRushManager.Instance.GetTabIDList();
+ if (list.IsNullOrEmpty())
+ return;
+ int id = list.First();
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return;
+ int roundType = config.RoundType;
+
+ bgImage.SetSprite($"TimeRushEntry{roundType}");
+ bgImage.SetNativeSize();
+ titleText.text = Language.Get($"TimeRushEntryTitle{roundType}");
+ iconButton.SetListener(() =>
+ {
+ if (!UIManager.Instance.IsOpened<TimeRushWin>())
+ {
+ UIManager.Instance.OpenWindow<TimeRushWin>(0);
+ }
+ });
+ }
+
+}
diff --git a/Main/System/TimeRush/TimeRushCell.cs.meta b/Main/System/TimeRush/TimeRushCell.cs.meta
new file mode 100644
index 0000000..b982705
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cc10e231ecf97b9489602d412f470819
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushGiftCell.cs b/Main/System/TimeRush/TimeRushGiftCell.cs
new file mode 100644
index 0000000..96753ae
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushGiftCell.cs
@@ -0,0 +1,136 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TimeRushGiftCell : MonoBehaviour
+{
+ [SerializeField] TextEx titleText;
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] ButtonEx buyButton;
+ [SerializeField] ImageEx buyImage;
+ [SerializeField] TextEx buyText;
+ [SerializeField] TextEx buyText1;
+ [SerializeField] ImageEx moneyIconImage;
+ [SerializeField] TextEx limitCountText;
+ [SerializeField] ImageEx redImage;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+ StoreModel storeModel { get { return StoreModel.Instance; } }
+ public void Display(int index, List<TimeRushGiftItem> giftItems)
+ {
+ if (giftItems.IsNullOrEmpty() || index < 0 || index >= giftItems.Count)
+ return;
+ TimeRushGiftItem item = giftItems[index];
+ if (item.type == 0)
+ {
+ DisplayStore(item.id);
+ return;
+ }
+
+ DisplayCTG(item.id);
+ }
+
+ private void DisplayCTG(int ctgId)
+ {
+ redImage.SetActive(false);
+ buyText.SetActive(true);
+ buyText1.SetActive(false);
+ moneyIconImage.SetActive(false);
+
+ if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderConfig))
+ return;
+ if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out var rechargeCount))
+ return;
+ if (!CTGConfig.HasKey(ctgId))
+ return;
+ if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out var rechargeItemList))
+ return;
+
+ CTGConfig config = CTGConfig.Get(ctgId);
+
+ bool isCanBuy = manager.IsCanBuyCTG(ctgId);
+ titleText.text = config.Title;
+ buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2");
+ buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum));
+ limitCountText.SetActive(true);
+ limitCountText.text = Language.Get("TimeRush07", UIHelper.AppendColor(rechargeCount.totalCount >= config.TotalBuyCount ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, config.TotalBuyCount - rechargeCount.totalCount).ToString()));
+ buyButton.interactable = isCanBuy;
+ buyButton.SetListener(() =>
+ {
+ RechargeManager.Instance.CTG(ctgId);
+ });
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < rechargeItemList.Count)
+ {
+ var itemInfo = rechargeItemList[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel((int)itemInfo.id, false, itemInfo.countEx));
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show((int)itemInfo.id);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+
+ private void DisplayStore(int id)
+ {
+ if (!StoreConfig.HasKey(id))
+ return;
+ StoreConfig storeConfig = StoreConfig.Get(id);
+ int remainNum;
+ storeModel.TryGetIsSellOut(storeConfig, out remainNum);
+
+ bool isFree = manager.IsFree(id);
+ titleText.text = storeConfig.Name;
+
+ limitCountText.SetActive(!isFree);
+ limitCountText.text = Language.Get("TimeRush08", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.Green, Mathf.Max(0, remainNum).ToString(), true));
+
+ bool isCanBuy = manager.IsCanBuyShop(id);
+
+ redImage.SetActive(isFree && isCanBuy);
+ buyText.SetActive(isFree || !isCanBuy);
+ buyText.text = isFree ? Language.Get("L1127") : Language.Get("storename11");
+ buyText1.SetActive(!isFree && isCanBuy);
+ buyText1.text = UIHelper.GetMoneyFormat(storeConfig.MoneyNum);
+ moneyIconImage.SetActive(!isFree && isCanBuy);
+ moneyIconImage.SetIconWithMoneyType(1);
+ buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2");
+ buyButton.interactable = isCanBuy;
+ buyButton.SetListener(() =>
+ {
+ storeModel.SendBuyShopItemWithPopCheck(storeConfig, 1, (int)BuyStoreItemCheckType.ActGift);
+ });
+
+ var items = storeModel.GetShopItemlistByIndex(storeConfig);
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < items.Count)
+ {
+ var itemInfo = items[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel(itemInfo.itemId, false, itemInfo.count));
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemInfo.itemId);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+}
+public class TimeRushGiftItem
+{
+ public int type;//0 鍟嗗簵id 1 鍏呭�糹d
+ public int id;
+}
\ No newline at end of file
diff --git a/Main/System/TimeRush/TimeRushGiftCell.cs.meta b/Main/System/TimeRush/TimeRushGiftCell.cs.meta
new file mode 100644
index 0000000..93ca709
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushGiftCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8e9f60e895d200241adac4eec9b944d7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushManager.cs b/Main/System/TimeRush/TimeRushManager.cs
new file mode 100644
index 0000000..5fce2e5
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushManager.cs
@@ -0,0 +1,520 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class TimeRushManager : GameSystemManager<TimeRushManager>, IOpenServerActivity
+{
+
+
+ public Action PlayAnimationSync;
+
+ private bool isPlayAnimation = false;
+ public bool IsPlayAnimation
+ {
+ get
+ {
+ return isPlayAnimation;
+ }
+ set
+ {
+ isPlayAnimation = value;
+ if (isPlayAnimation)
+ {
+ PlayAnimationSync?.Invoke();
+ }
+ isPlayAnimation = false;
+ }
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_Activity2;
+ public const int activityID = (int)NewDayActivityID.TimeRushAct;
+ public int actNum = 10;
+ public static OperationType operaType = OperationType.default47;
+ public Redpoint redPoint = new Redpoint(MainRedDot.TimeRushRepoint);
+
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+
+ public event Action<int> onStateUpdate;
+
+ //绫诲瀷瀵瑰簲鍔熻兘ID
+ public Dictionary<int, int> funcIdDict = new Dictionary<int, int>();
+
+ public bool TryGetFuncIdByRoundType(int roundType, out int funcId)
+ {
+ return funcIdDict.TryGetValue(roundType, out funcId);
+ }
+
+ //绫诲瀷瀵瑰簲绐楀彛ID
+ public Dictionary<int, int> windowIDDict = new Dictionary<int, int>();
+
+ public bool TryGetWindowIDByRoundType(int roundType, out int windowID)
+ {
+ return windowIDDict.TryGetValue(roundType, out windowID);
+ }
+ public Dictionary<int, int> moneyTypeDict = new Dictionary<int, int>();
+ public bool TryGetMoneyTypeByRoundType(int roundType, out int windowID)
+ {
+ return moneyTypeDict.TryGetValue(roundType, out windowID);
+ }
+ public override void Init()
+ {
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
+ //storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
+ OpenServerActivityCenter.Instance.Register(activityID, this, activityType);
+
+ var config = FuncConfigConfig.Get("TimeRush");
+ windowIDDict = ConfigParse.ParseIntDict(config.Numerical1);
+ funcIdDict = ConfigParse.ParseIntDict(config.Numerical2);
+ moneyTypeDict = ConfigParse.ParseIntDict(config.Numerical3);
+
+ }
+
+ public override void Release()
+ {
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
+ }
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ UpdateRedpoint();
+ }
+ }
+
+ private void RefreshBuyShopLimitEvent()
+ {
+ UpdateRedpoint();
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ if (onStateUpdate != null)
+ {
+ onStateUpdate(activityID);
+ }
+ UpdateRedpoint();
+ }
+ }
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ if (onStateUpdate != null)
+ {
+ onStateUpdate(activityID);
+ }
+
+ if (UIManager.Instance.IsOpened<TimeRushWin>())
+ {
+ UIManager.Instance.CloseWindow<TimeRushWin>();
+ }
+ UpdateRedpoint();
+ }
+ }
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ if (onStateUpdate != null)
+ {
+ onStateUpdate(activityID);
+ }
+ UpdateRedpoint();
+ }
+ }
+
+ public bool TryGetOperationInfo(out OperationCycleHall act)
+ {
+ act = null;
+ return OperationTimeHepler.Instance.TryGetOperation(operaType, out act) && act != null;
+ }
+
+ public bool TryGetInListIndexById(int id, out int index)
+ {
+ index = -1;
+ var list = GetTabIDList();
+ if (list.IsNullOrEmpty() || !list.Contains(id))
+ return false;
+ index = list.IndexOf(id);
+ return index >= 0;
+ }
+
+ public bool IsFuncOpen()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.TimeRush))
+ return false;
+ if (!IsOpen)
+ return false;
+ if (!TryGetOperationInfo(out OperationCycleHall act))
+ return false;
+ List<int> list = GetTabIDList();
+ if (list.IsNullOrEmpty())
+ return false;
+ return true;
+ }
+
+
+ private int m_NowTabId;
+ public event Action OnNowTabIdChangeEvent;
+ public int nowTabId
+ {
+ get { return m_NowTabId; }
+ set
+ {
+ if (m_NowTabId != value)
+ m_NowTabId = value;
+ OnNowTabIdChangeEvent?.Invoke();
+ }
+ }
+
+ public List<int> GetTabIDList()
+ {
+ if (!TryGetOperationInfo(out OperationCycleHall act))
+ return null;
+ var list = ActLunhuidianTypeConfig.GetTabList();
+ if (list.IsNullOrEmpty())
+ return null;
+
+ List<int> resList = new List<int>();
+ for (int i = 0; i < list.Count; i++)
+ {
+ int id = list[i];
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ continue;
+ if (!act.TryGetRound(config.RoundType, out var info))
+ continue;
+
+ //娌¢厤鍔熻兘ID鐩存帴鍔犲叆
+ if (!funcIdDict.TryGetValue(config.RoundType, out var funcId))
+ {
+ if (!resList.Contains(id))
+ resList.Add(id);
+ continue;
+ }
+
+ //閰嶄簡鍔熻兘ID锛屽垽鏂姛鑳芥槸鍚﹀紑鍚�
+ if (FuncOpen.Instance.IsFuncOpen(funcId))
+ {
+ if (!resList.Contains(id))
+ resList.Add(id);
+ }
+ }
+ return resList;
+ }
+ public Dictionary<int, HAA89_tagMCActLunhuidianPlayerInfo> playerInfoDict = new Dictionary<int, HAA89_tagMCActLunhuidianPlayerInfo>();
+ public bool TryGetPlayerInfo(int roundType, out HAA89_tagMCActLunhuidianPlayerInfo playerInfo)
+ {
+ return playerInfoDict.TryGetValue(roundType, out playerInfo) && playerInfo != null;
+ }
+
+ public event Action OnUpdatePlayerInfoEvent;
+ public void UpdatePlayerInfo(HAA89_tagMCActLunhuidianPlayerInfo netPack)
+ {
+ if (actNum != netPack.ActNum)
+ return;
+ if (!playerInfoDict.ContainsKey(netPack.RoundType))
+ playerInfoDict[netPack.RoundType] = new HAA89_tagMCActLunhuidianPlayerInfo();
+ playerInfoDict[netPack.RoundType].RoundType = netPack.RoundType;
+ playerInfoDict[netPack.RoundType].CurRound = netPack.CurRound;
+ playerInfoDict[netPack.RoundType].CurValue = netPack.CurValue;
+ playerInfoDict[netPack.RoundType].AwardRecord = netPack.AwardRecord;
+ CheckNewAwardHave(netPack.RoundType, (int)netPack.CurRound, (int)netPack.CurValue);
+ OnUpdatePlayerInfoEvent?.Invoke();
+ UpdateRedpoint();
+ }
+
+ public int newRoundType;
+ public int newAwardType;
+ public int newAwardTypeValue;
+ public int newAwardIndex;
+ // <杞洖绫诲瀷, 涓婁竴娆$殑CurRound>
+ public Dictionary<int, int> lastCurRoundDict = new Dictionary<int, int>();
+
+ // <杞洖绫诲瀷, 涓婁竴娆$殑CurValue>
+ public Dictionary<int, int> lastCurValueDict = new Dictionary<int, int>();
+ public void CheckNewAwardHave(int roundType, int curRound, int curValue)
+ {
+ if (lastCurRoundDict.ContainsKey(roundType) && lastCurValueDict.ContainsKey(roundType))
+ {
+ int lastCurRound = lastCurRoundDict[roundType];
+ int lastCurValue = lastCurValueDict[roundType];
+ if (lastCurRound < curRound)
+ {
+ lastCurValueDict[roundType] = 0;
+ }
+
+ lastCurValue = lastCurValueDict[roundType];
+ if (lastCurValue < curValue)
+ {
+ if (!TryGetOperationInfo(out var act))
+ return;
+ if (act.TryGetRound(roundType, out var round) && round.AwardList != null)
+ {
+ for (int i = 0; i < round.AwardList.Length; i++)
+ {
+ var Award = round.AwardList[i];
+ int state = GetAwardState(roundType, Award.AwardIndex);
+ if (Award.NeedValue > lastCurValue && Award.NeedValue <= curValue && state == 1)
+ {
+ newRoundType = roundType;
+ newAwardType = round.AwardType;
+ newAwardTypeValue = (int)round.AwardTypeValue;
+ newAwardIndex = Award.AwardIndex;
+ // if (!DTC0403_tagPlayerLoginLoadOK.neverLoginOk && !WindowCenter.Instance.IsOpen<CycleHallAchievementTipWin>())
+ // {
+ // WindowCenter.Instance.Open<CycleHallAchievementTipWin>();
+ // }
+ // UpdateNewAwardHave?.Invoke();
+ }
+ }
+ }
+ }
+ }
+ lastCurRoundDict[roundType] = curRound;
+ lastCurValueDict[roundType] = curValue;
+ }
+
+
+ public int GetAwardState(int roundType, int awardIndex)
+ {
+ if (!TryGetPlayerInfo(roundType, out var playerInfo))
+ return 0;
+ if (!TryGetOperationInfo(out var act))
+ return 0;
+ if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex))
+ return 0;
+
+ if (playerInfo.CurValue >= awardInfo.NeedValue)
+ {
+ return (playerInfo.AwardRecord & (1 << awardIndex)) != 0 ? 2 : 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ public void HaveAllMissionAward(int roundType)
+ {
+ if (!TryGetOperationInfo(out var act))
+ return;
+ if (!act.TryGetRound(roundType, out var round) || round.AwardList == null)
+ return;
+
+ for (int i = 0; i < round.AwardList.Length; i++)
+ {
+ var award = round.AwardList[i];
+ int state = GetAwardState(roundType, award.AwardIndex);
+ if (state == 1)
+ {
+ SendGetAward(roundType, (int)award.NeedValue);
+ }
+ }
+ }
+
+ public bool IsCanBuyCTG(int ctgID)
+ {
+ if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount))
+ return false;
+ if (!CTGConfig.HasKey(ctgID))
+ return false;
+ CTGConfig config = CTGConfig.Get(ctgID);
+ return rechargeCount.totalCount < config.TotalBuyCount;
+ }
+
+ public bool IsFree(int shopID)
+ {
+ if (!StoreConfig.HasKey(shopID))
+ return false;
+ StoreConfig config = StoreConfig.Get(shopID);
+ return config.MoneyNum == 0;
+ }
+
+ public bool IsCanBuyShop(int shopID)
+ {
+ if (!StoreConfig.HasKey(shopID))
+ return false;
+ StoreConfig config = StoreConfig.Get(shopID);
+
+ int remainNum;
+ StoreModel.Instance.TryGetIsSellOut(config, out remainNum);
+
+ return remainNum > 0;
+ }
+
+ public List<TimeRushGiftItem> GetGiftItemList(int roundType, bool isSort = false)
+ {
+ List<TimeRushGiftItem> res = new List<TimeRushGiftItem>();
+ if (TryGetOperationInfo(out var act) && act.TryGetRound(roundType, out var round) && round.CTGIDList != null)
+ {
+ var list = StoreModel.Instance.storeTypeDict[round.ShopType];
+ if (!list.IsNullOrEmpty())
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ var item = list[i];
+ if (item.storeConfig == null)
+ continue;
+ res.Add(new TimeRushGiftItem
+ {
+ type = 0,
+ id = item.storeConfig.ID,
+ });
+ }
+ }
+
+ for (int i = 0; i < round.CTGIDList.Length; i++)
+ {
+ var item = round.CTGIDList[i];
+ res.Add(new TimeRushGiftItem
+ {
+ type = 1,
+ id = item,
+ });
+ }
+
+ if (isSort)
+ {
+ res = res.OrderBy(item =>
+ {
+ bool isCanBuy = item.type == 0 ? IsCanBuyShop(item.id) : IsCanBuyCTG(item.id);
+ return !isCanBuy;
+ })
+ .ThenBy(item => item.type)
+ .ThenBy(item => item.id)
+ .ToList();
+ }
+
+ }
+ return res;
+ }
+
+ public List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> GetTaskList(int roundType, bool isSort = false)
+ {
+ if (!TryGetOperationInfo(out var act) || !act.TryGetRound(roundType, out var round) || round.AwardList == null)
+ return null;
+
+ List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> res = round.AwardList.ToList();
+
+ if (isSort)
+ {
+ // 鍏堣幏鍙栫姸鎬佸苟缂撳瓨锛岄伩鍏嶆帓搴忔椂閲嶅璋冪敤 GetAwardState
+ res = res.Select(award => new
+ {
+ Data = award,
+ State = GetAwardState(roundType, award.AwardIndex)
+ }).OrderBy(x =>
+ {
+ // 瀹氫箟浼樺厛绾ф槧灏勶細鏁板瓧瓒婂皬锛屾帓寰楄秺闈犲墠
+ if (x.State == 1) return 0; // 鏈�鍓嶏細鍙鍙�
+ if (x.State == 0) return 1; // 涓棿锛氭湭杈炬垚
+ return 2; // 鏈�鍚庯細宸查鍙� (state == 2)
+ })
+ .ThenBy(x => x.Data.AwardIndex) // 鐘舵�佺浉鍚屾椂锛孉wardIndex 灏忕殑鍦ㄥ墠
+ .Select(x => x.Data) // 鎻愬彇鍥炲師濮嬫暟鎹粨鏋�
+ .ToList();
+ }
+ return res;
+ }
+
+
+ public bool IsTabShowRed(int id)
+ {
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return false;
+ int roundType = config.RoundType;
+ int tabType = config.TabType;
+ if (tabType == 1)
+ {
+ var taskList = GetTaskList(roundType);
+ if (taskList.IsNullOrEmpty())
+ return false;
+ for (int i = 0; i < taskList.Count; i++)
+ {
+ var task = taskList[i];
+ int state = GetAwardState(roundType, task.AwardIndex);
+ if (state == 1)
+ return true;
+ }
+ return false;
+ }
+
+ var list = GetGiftItemList(roundType);
+ if (list.IsNullOrEmpty())
+ return false;
+ for (int i = 0; i < list.Count; i++)
+ {
+ var item = list[i];
+ if (item.type == 0)
+ {
+ bool isFree = IsFree(item.id);
+ bool isCanBuy = IsCanBuyShop(item.id);
+ if (isFree && isCanBuy)
+ return true;
+
+ }
+ }
+ return false;
+ }
+
+ public void SendGetAward(int roundType, int needValue)
+ {
+ CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
+ getReward.RewardType = 78;
+ getReward.DataEx = (uint)actNum;
+ getReward.DataExStr = StringUtility.Concat(roundType.ToString(), "|", needValue.ToString());
+ getReward.DataExStrLen = (byte)getReward.DataExStr.Length;
+ GameNetSystem.Instance.SendInfo(getReward);
+ }
+
+ public void UpdateRedpoint()
+ {
+ redPoint.state = RedPointState.None;
+ if (!IsFuncOpen())
+ return;
+ if (!TryGetOperationInfo(out var act) || act.roundInfoDict == null)
+ return;
+ foreach (var roundType in act.roundInfoDict.Keys)
+ {
+ ActLunhuidianTypeConfig config;
+
+ if (ActLunhuidianTypeConfig.TryGetConfig(roundType, 1, out config))
+ {
+ bool isShow = IsTabShowRed(config.ID);
+ if (isShow)
+ {
+ redPoint.state = RedPointState.Simple;
+ return;
+ }
+ }
+
+ if (ActLunhuidianTypeConfig.TryGetConfig(roundType, 2, out config))
+ {
+ bool isShow = IsTabShowRed(config.ID);
+ if (isShow)
+ {
+ redPoint.state = RedPointState.Simple;
+ return;
+ }
+ }
+ }
+
+
+ }
+}
diff --git a/Main/System/TimeRush/TimeRushManager.cs.meta b/Main/System/TimeRush/TimeRushManager.cs.meta
new file mode 100644
index 0000000..f1d1621
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 84c9a9bfadc4e62499711a6785fd2ad0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushTabCell.cs b/Main/System/TimeRush/TimeRushTabCell.cs
new file mode 100644
index 0000000..b2374f3
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTabCell.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+public class TimeRushTabCell : MonoBehaviour
+{
+ [SerializeField] Color unSelectColor;
+ [SerializeField] Color selectColor;
+ [SerializeField] ImageEx bgImage;
+ [SerializeField] TextEx titleText;
+ [SerializeField] ImageEx redImage;
+ [SerializeField] ButtonEx tabButton;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+ public void Display(int id)
+ {
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return;
+ bgImage.SetSprite(manager.nowTabId == id ? "TimeRushTabSelect" : "TimeRushTabUnSelect");
+ bgImage.SetNativeSize();
+ titleText.text = config.TabName;
+ titleText.color = manager.nowTabId == id ? selectColor : unSelectColor;
+
+ redImage.SetActive(manager.IsTabShowRed(id));
+
+ tabButton.SetListener(() =>
+ {
+ manager.nowTabId = id;
+ });
+ }
+
+}
diff --git a/Main/System/TimeRush/TimeRushTabCell.cs.meta b/Main/System/TimeRush/TimeRushTabCell.cs.meta
new file mode 100644
index 0000000..07d9ad3
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTabCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 65202a9b70b44c747913e0d851db8707
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushTaskCell.cs b/Main/System/TimeRush/TimeRushTaskCell.cs
new file mode 100644
index 0000000..523cf42
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTaskCell.cs
@@ -0,0 +1,137 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TimeRushTaskCell : MonoBehaviour
+{
+ [SerializeField] ButtonEx clickButton;
+ [SerializeField] TextEx titleText;
+ [SerializeField] ImageEx sliderImage;
+ [SerializeField] ImageEx maskImage;
+ [SerializeField] TextEx sliderText;
+ [SerializeField] TimeRushTaskItem[] items;
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] ImageEx[] grays;
+ [SerializeField] RotationTween[] tweens;
+ [SerializeField] UIEffectPlayer uiEffectPlayer;
+
+ int awardIndex;
+ int roundType;
+ int tabType;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+
+ private void OnEnable()
+ {
+ manager.PlayAnimationSync += OnPlaySyncAnimation;
+ for (int i = 0; i < tweens.Length; i++)
+ {
+ tweens[i].Stop();
+ tweens[i].SetStartState();
+ }
+
+ if (!manager.TryGetOperationInfo(out var act))
+ return;
+ if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
+ return;
+ int state = manager.GetAwardState(roundType, awardIndex);
+ for (int i = 0; i < tweens.Length; i++)
+ {
+ if (i < awardInfo.AwardItemList.Length)
+ {
+ if (state == 1)
+ {
+ tweens[i].Play();
+ }
+ }
+ }
+
+ }
+
+ private void OnDisable()
+ {
+ manager.PlayAnimationSync -= OnPlaySyncAnimation;
+ }
+
+ private void OnPlaySyncAnimation()
+ {
+ if (tabType != 1)
+ return;
+ for (int i = 0; i < tweens.Length; i++)
+ {
+ tweens[i].Stop();
+ tweens[i].SetStartState();
+ }
+ if (!manager.TryGetOperationInfo(out var act))
+ return;
+ if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
+ return;
+ int state = manager.GetAwardState(roundType, awardIndex);
+ for (int i = 0; i < tweens.Length; i++)
+ {
+ if (tweens[i].isActiveAndEnabled && state == 1)
+ {
+ tweens[i].Play();
+ }
+ }
+ }
+
+ public void Display(int index, CellView cell, List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> taskList)
+ {
+
+ roundType = cell.info.Value.infoInt1;
+ tabType = cell.info.Value.infoInt2;
+ if (taskList.IsNullOrEmpty() || index < 0 || index >= taskList.Count)
+ return;
+ var task = taskList[index];
+ awardIndex = task.AwardIndex;
+ if (!manager.TryGetOperationInfo(out var act))
+ return;
+ if (!act.TryGetRound(roundType, out var round))
+ return;
+ if (!manager.TryGetPlayerInfo(roundType, out var playerInfo))
+ return;
+ int state = manager.GetAwardState(roundType, awardIndex);
+ maskImage.SetActive(state == 2);
+ uiEffectPlayer.SetActive(state == 1);
+ titleText.text = Language.Get($"TimeRushTaskTitle_{round.AwardType}_{round.AwardTypeValue}", task.NeedValue);
+ sliderImage.fillAmount = playerInfo.CurValue / (float)task.NeedValue;
+ sliderText.text = Language.Get("BoneField09", playerInfo.CurValue, task.NeedValue);
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < task.AwardItemList.Length)
+ {
+ var itemInfo = task.AwardItemList[i];
+ itemBaisc.SetActive(true);
+ grays[i].SetActive(state == 2);
+ ItemCellModel cellModel = new ItemCellModel((int)itemInfo.ItemID, false, itemInfo.ItemCount);
+ itemBaisc.Init(cellModel);
+ itemBaisc.button.AddListener(() =>
+ {
+ if (state == 1)
+ {
+ manager.HaveAllMissionAward(roundType);
+ }
+ else
+ {
+ ItemTipUtility.Show((int)itemInfo.ItemID);
+ }
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ grays[i].SetActive(false);
+ }
+ }
+
+ clickButton.SetListener(() =>
+ {
+ if (state == 1)
+ {
+ manager.HaveAllMissionAward(roundType);
+ }
+ });
+ }
+
+}
diff --git a/Main/System/TimeRush/TimeRushTaskCell.cs.meta b/Main/System/TimeRush/TimeRushTaskCell.cs.meta
new file mode 100644
index 0000000..c420f83
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTaskCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9f2398658c04b264eba2671ce96dc050
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushTaskItem.cs b/Main/System/TimeRush/TimeRushTaskItem.cs
new file mode 100644
index 0000000..0a636f4
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTaskItem.cs
@@ -0,0 +1,42 @@
+using UnityEngine;
+
+public class TimeRushTaskItem : MonoBehaviour
+{
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] ImageEx gray;
+ [SerializeField] RotationTween tween;
+
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+ public void Display(int state, int roundType, int itemId, int count)
+ {
+
+ gray.SetActive(state == 2);
+
+ ItemCellModel cellModel = new ItemCellModel(itemId, false, count);
+ itemCell.Init(cellModel);
+ itemCell.button.AddListener(() =>
+ {
+ if (state == 1)
+ {
+ manager.HaveAllMissionAward(roundType);
+ }
+ else
+ {
+ ItemTipUtility.Show(itemId);
+ }
+ });
+ }
+
+ public void Play()
+ {
+ if (!gameObject.activeSelf)
+ return;
+ tween.Play();
+ }
+
+ public void Stop()
+ {
+ tween.Stop();
+ tween.SetStartState();
+ }
+}
diff --git a/Main/System/TimeRush/TimeRushTaskItem.cs.meta b/Main/System/TimeRush/TimeRushTaskItem.cs.meta
new file mode 100644
index 0000000..86e647e
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTaskItem.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 46c5176f8abbd614aa070785103e53a7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/TimeRush/TimeRushWin.cs b/Main/System/TimeRush/TimeRushWin.cs
new file mode 100644
index 0000000..559f3eb
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushWin.cs
@@ -0,0 +1,294 @@
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+
+public class TimeRushWin : UIBase
+{
+ [SerializeField] ScrollerController tabScroller;
+ [SerializeField] ScrollerController taskScroller;
+ [SerializeField] ScrollerController giftScroller;
+ [SerializeField] ImageEx bgImage;
+ [SerializeField] ImageEx infoBgImage;
+ [SerializeField] ImageEx infoImage;
+ [SerializeField] ImageEx titleBgImage;
+ [SerializeField] GradientText titleText;
+ [SerializeField] ImageEx giftBgImage;
+ [SerializeField] ImageEx giftIconImage;
+ [SerializeField] TextEx timeText;
+ [SerializeField] TextEx roundText;
+ [SerializeField] ButtonEx goButton;
+ [SerializeField] TextEx goText;
+ [SerializeField] OwnMoneyCell ownMoneyCell;
+ [SerializeField] ButtonEx closeButton;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+ StoreModel storeModel { get { return StoreModel.Instance; } }
+ int tabId;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ }
+
+ protected override void OnPreOpen()
+ {
+ tabId = functionOrder;
+ manager.OnNowTabIdChangeEvent += OnNowTabIdChangeEvent;
+ tabScroller.OnRefreshCell += OnRefreshTabCell;
+ taskScroller.OnRefreshCell += OnRefreshTaskCell;
+ giftScroller.OnRefreshCell += OnRefreshGiftCell;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
+ manager.OnUpdatePlayerInfoEvent += OnUpdatePlayerInfoEvent;
+
+ var list = manager.GetTabIDList();
+ if (list.IsNullOrEmpty())
+ {
+ DelayCloseWindow().Forget();
+ return;
+ }
+ manager.nowTabId = list.Contains(tabId) ? tabId : list[0];
+
+ }
+
+ protected override void OnPreClose()
+ {
+ manager.OnNowTabIdChangeEvent -= OnNowTabIdChangeEvent;
+ tabScroller.OnRefreshCell -= OnRefreshTabCell;
+ taskScroller.OnRefreshCell -= OnRefreshTaskCell;
+ giftScroller.OnRefreshCell -= OnRefreshGiftCell;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
+ manager.OnUpdatePlayerInfoEvent -= OnUpdatePlayerInfoEvent;
+ }
+
+ private void OnUpdatePlayerInfoEvent()
+ {
+ RefreshAll();
+ }
+
+ private void RefreshBuyShopLimitEvent()
+ {
+ RefreshAll();
+ }
+
+ private void OperationTimeUpdateEvent(OperationType operation)
+ {
+ if (operation == OperationType.default47)
+ {
+ RefreshAll();
+ }
+ }
+
+ private void OnRechargeCountEvent(int obj)
+ {
+ RefreshAll();
+ }
+
+ private void OnSecondEvent()
+ {
+ GetActTime();
+ }
+
+ private void OnRefreshTabCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<TimeRushTabCell>();
+ _cell?.Display(cell.index);
+ }
+
+ private void OnRefreshTaskCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<TimeRushTaskCell>();
+ _cell?.Display(cell.index, cell, taskList);
+ }
+
+ private void OnRefreshGiftCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<TimeRushGiftCell>();
+ _cell?.Display(cell.index, giftItems);
+ manager.PlayAnimationSync?.Invoke();
+ }
+
+ private void OnNowTabIdChangeEvent()
+ {
+ CreateAll();
+ }
+ void RefreshAll()
+ {
+ int id = manager.nowTabId;
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return;
+ int roundType = config.RoundType;
+ int tabType = config.TabType;
+
+ tabScroller.m_Scorller.RefreshActiveCellViews();
+
+ taskScroller.SetActive(tabType == 1);
+ giftScroller.SetActive(tabType == 2);
+
+ if (tabType == 1)
+ {
+ CreateTaskScroller(roundType, tabType);
+ return;
+ }
+
+ if (tabType == 2)
+ {
+ CreateGiftScroller(roundType);
+ return;
+ }
+ Display(id);
+ }
+
+ void CreateAll()
+ {
+ int id = manager.nowTabId;
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return;
+ if (!manager.TryGetOperationInfo(out var act))
+ return;
+ int roundType = config.RoundType;
+ int tabType = config.TabType;
+ if (!act.TryGetRound(roundType, out var round))
+ return;
+
+
+ Display(id);
+ CreateTabScroller();
+ taskScroller.SetActive(tabType == 1);
+ giftScroller.SetActive(tabType == 2);
+
+ if (tabType == 1)
+ {
+ CreateTaskScroller(roundType, tabType);
+ return;
+ }
+
+ if (tabType == 2)
+ {
+ CreateGiftScroller(roundType);
+ return;
+ }
+
+ }
+
+ private void Display(int id)
+ {
+ if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config))
+ return;
+ if (!manager.TryGetOperationInfo(out var act))
+ return;
+ int roundType = config.RoundType;
+ int tabType = config.TabType;
+ if (!act.TryGetRound(roundType, out var round))
+ return;
+ if (!manager.TryGetPlayerInfo(roundType, out var playerInfo))
+ return;
+
+ GetActTime();
+ bgImage.SetSprite(config.bgImage);
+
+ infoBgImage.SetSprite(config.InfoBgImage);
+
+ infoImage.SetSprite(config.InfoImage);
+ infoImage.SetNativeSize();
+
+ titleBgImage.SetSprite(config.TitleBgImage);
+ titleBgImage.SetNativeSize();
+
+ titleText.text = Language.Get($"TimeRushTitle{roundType}");
+
+ roundText.SetActive(tabType == 1);
+ roundText.text = tabType == 1 ? Language.Get("TimeRush06", playerInfo.CurRound, round.RoundMax) : string.Empty;
+
+ ownMoneyCell.SetActive(tabType == 2);
+ ownMoneyCell.moneyType = manager.TryGetMoneyTypeByRoundType(roundType, out int monetyType) ? monetyType : 99;
+ ownMoneyCell.Display(true);
+ giftBgImage.SetActive(tabType == 2);
+
+ giftIconImage.SetActive(tabType == 2);
+ giftIconImage.SetSprite($"TimeRushGiftIcon{roundType}");
+
+ DisplayGoButton(config);
+ }
+
+
+ void DisplayGoButton(ActLunhuidianTypeConfig config)
+ {
+ int roundType = config.RoundType;
+ int tabType = config.TabType;
+ bool hasWindowID = manager.TryGetWindowIDByRoundType(roundType, out int windowID);
+ goButton.SetActive(tabType == 1 && hasWindowID);
+ if (tabType == 1 && hasWindowID)
+ {
+ goText.text = Language.Get($"TimeRushGoTitle{roundType}");
+ goButton.SetListener(() =>
+ {
+ if (manager.TryGetFuncIdByRoundType(roundType, out int funcId) && !FuncOpen.Instance.IsFuncOpen(funcId, true))
+ return;
+ UIJumpManager.Instance.OpenWindow(windowID);
+ });
+ }
+ }
+
+ private void GetActTime()
+ {
+ if (!manager.TryGetOperationInfo(out var act))
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get("TimeRush05", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+
+ private void CreateTabScroller()
+ {
+ tabScroller.Refresh();
+ var list = manager.GetTabIDList();
+ if (!list.IsNullOrEmpty())
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ tabScroller.AddCell(ScrollerDataType.Header, list[i]);
+ }
+ }
+ tabScroller.Restart();
+ }
+
+
+ List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> taskList;
+ private void CreateTaskScroller(int roundType, int tabType)
+ {
+ taskList = manager.GetTaskList(roundType, true);
+ taskScroller.Refresh();
+ if (!taskList.IsNullOrEmpty())
+ {
+ for (int i = 0; i < taskList.Count; i++)
+ {
+ CellInfo cellInfo = new CellInfo();
+ cellInfo.infoInt1 = roundType;
+ cellInfo.infoInt2 = tabType;
+ taskScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
+ }
+ }
+ taskScroller.Restart();
+ }
+
+ List<TimeRushGiftItem> giftItems;
+ private void CreateGiftScroller(int roundType)
+ {
+ giftItems = manager.GetGiftItemList(roundType, true);
+ giftScroller.Refresh();
+ if (!giftItems.IsNullOrEmpty())
+ {
+ for (int i = 0; i < giftItems.Count; i++)
+ {
+ giftScroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ giftScroller.Restart();
+ }
+
+}
diff --git a/Main/System/TimeRush/TimeRushWin.cs.meta b/Main/System/TimeRush/TimeRushWin.cs.meta
new file mode 100644
index 0000000..84ffb3c
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 37423ca15fdd33e45b288c668a3698a5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 77b4e4b..259009d 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -849,6 +849,7 @@
WarlordPavilion = 55, //瀹氬啗闃�
FuncPreset = 56, //娴佹淳棰勮
TimingGift = 57, //鏃舵満绀煎寘
+ TimeRush = 58, //闄愭椂鍐插埡
}
@@ -1819,7 +1820,7 @@
FairyAffinityLoginAct = 214, //浠欑紭鐧婚檰娲诲姩
FairyAffinityMissionAct = 215, //浠欑紭浠诲姟娲诲姩
FairyAffinityRechargeGiftAct = 216, //浠欑紭绀煎寘娲诲姩
- CycleHallAct = 217, //杞洖娈挎椿鍔�
+ TimeRushAct = 217, //杞洖娈挎椿鍔�
YunShiXBAct = 218, //杩愬娍瀵诲疂娲诲姩
YunShiMissionAct = 219, //杩愬娍浠诲姟娲诲姩
YunShiRechargeGiftAct = 220, //杩愬娍绀煎寘娲诲姩
--
Gitblit v1.8.0