From 9fb3c8e114a67c0cdf353b32b1b50e90414fd597 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 25 二月 2026 16:34:07 +0800
Subject: [PATCH] Merge branch 'master' into h5version
---
Main/System/TimeRush/TimeRushGiftCell.cs.meta | 11
Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta | 11
Main/System/Chat/ChatPlayerMineCell.cs | 7
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs | 12
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs | 79 +
Main/ResModule/ResManager.cs | 21
Main/System/Redpoint/MainRedDot.cs | 11
Main/System/Video/UIVideoPlayer.cs | 505 +++++++++
Main/System/Guild/GuildBossWin.cs | 1
Main/System/TimeRush/TimeRushWin.cs | 301 +++++
Main/System/Video/VideoManager.cs.meta | 11
Main/System/TimeRush/TimeRushManager.cs.meta | 11
Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta | 11
Main/System/TimeRush/TimeRushGiftCell.cs | 136 ++
Main/System/TimingGift/TimingGiftWin.cs | 5
Main/Utility/EnumHelper.cs | 3
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta | 11
Main/System/TimeRush/TimeRushTipWin.cs.meta | 11
Main/Manager/UIManager.cs | 2
Main/System/TimeRush/TimeRushTaskCell.cs | 136 ++
Main/System/BeautyMM/BeautyMMTravelWin.cs | 2
Main/System/TimeRush/TimeRushCell.cs | 32
Main/System/TimeRush/OperationCycleHall.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta | 11
Main/System/OpenServerActivity/OperationTimeHepler.cs | 72
Main/Config/Configs/HeroSkinConfig.cs | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs | 14
Main/System/Chat/ChatManager.cs | 41
Main/System/TimeRush/TimeRushTabCell.cs | 29
Main/System/Video/VideoWin.cs.meta | 11
Main/Config/ConfigManager.cs | 6
Main/System/KnapSack/Logic/ItemLogicUtility.cs | 6
Main/System/TimingGift/TimingGiftManager.cs | 122 ++
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta | 11
Main/System/Chat/ChatWin.cs | 63 +
Main/System/Battle/BattleObject/BattleObjectLayerMgr.cs | 2
Main/System/Battle/BattleField/BattleField.cs | 2
Main/System/ItemTip/ItemBatchUseWin.cs | 116 -
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs | 25
Main/System/Main/HomeWin.cs | 31
Main/System/Video/VideoManager.cs | 117 ++
Main/Main.cs | 1
Main/System/Chat/ChatBulletView.cs | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta | 11
Main/System/Battle/BattleEffectMgr.cs | 10
Main/System/Guild/GuildManager.cs | 22
Main/System/Video.meta | 8
Main/Utility/Extension.cs | 59 +
Main/System/Guild/GuildBossManager.cs | 6
Main/System/TimeRush/TimeRushTaskCell.cs.meta | 11
Main/System/Hero/UIHeroController.cs | 19
Main/Config/Configs/ActLunhuidianTypeConfig.cs | 62 +
Main/System/HappyXB/HeroCallWin.cs | 9
Main/System/TimeRush/TimeRushTabCell.cs.meta | 11
Main/System/TimeRush/TimeRushManager.cs | 522 +++++++++
Main/System/BeautyMM/BeautyMMManager.cs | 9
Main/System/TimeRush/OperationCycleHall.cs | 84 +
Main/System/Chat/ChatPlayerOtherCell.cs | 9
Main/System/Video/UIVideoPlayer.cs.meta | 11
Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs | 54 +
Main/System/Video/VideoWin.cs | 20
Main/System/TimeRush/TimeRushTipWin.cs | 140 ++
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2
Main/System/TimeRush.meta | 8
Main/System/TimeRush/TimeRushCell.cs.meta | 11
Main/System/TimeRush/TimeRushWin.cs.meta | 11
66 files changed, 2,964 insertions(+), 179 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index e673ab1..37cc055 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),
@@ -91,6 +92,7 @@
typeof(PlayerAttrConfig),
typeof(PlayerFaceConfig),
typeof(PresetUnlockConfig),
+ typeof(PriorBundleConfig),
typeof(RandomNameConfig),
typeof(SignInConfig),
typeof(SkillSkinConfig),
@@ -296,6 +298,8 @@
public override void Release()
{
+ // 娓呯┖ ActLunhuidianTypeConfig 瀛楀吀
+ ClearConfigDictionary<ActLunhuidianTypeConfig>();
// 娓呯┖ ADAwardConfig 瀛楀吀
ClearConfigDictionary<ADAwardConfig>();
// 娓呯┖ BattleMapConfig 瀛楀吀
@@ -402,6 +406,8 @@
ClearConfigDictionary<PlayerFaceConfig>();
// 娓呯┖ PresetUnlockConfig 瀛楀吀
ClearConfigDictionary<PresetUnlockConfig>();
+ // 娓呯┖ PriorBundleConfig 瀛楀吀
+ ClearConfigDictionary<PriorBundleConfig>();
// 娓呯┖ RandomNameConfig 瀛楀吀
ClearConfigDictionary<RandomNameConfig>();
// 娓呯┖ SignInConfig 瀛楀吀
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/Configs/HeroSkinConfig.cs b/Main/Config/Configs/HeroSkinConfig.cs
index 5953ef7..fded4ef 100644
--- a/Main/Config/Configs/HeroSkinConfig.cs
+++ b/Main/Config/Configs/HeroSkinConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Friday, November 14, 2025
+// [ Date ]: 2026骞�2鏈�13鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -27,6 +27,9 @@
public string RectangleIcon;
public string SpineRes;
public string InitialSkinName;
+ public string ApearMotionName;
+ public string TransfMotionName;
+ public string LoopMotionName;
public override int LoadKey(string _key)
{
@@ -119,6 +122,12 @@
SpineRes = tables[9];
InitialSkinName = tables[10];
+
+ ApearMotionName = tables[11];
+
+ TransfMotionName = tables[12];
+
+ LoopMotionName = tables[13];
}
catch (Exception exception)
{
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 bd05988..ba05126 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -116,6 +116,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/Manager/UIManager.cs b/Main/Manager/UIManager.cs
index b574a97..b589778 100644
--- a/Main/Manager/UIManager.cs
+++ b/Main/Manager/UIManager.cs
@@ -657,7 +657,7 @@
}
else
{
- prefab = await ResManager.Instance.LoadAssetAsync<GameObject>("UI", uiName);
+ prefab = await ResManager.Instance.LoadAssetAsync<GameObject>("UI", uiName, true);
}
if (prefab == null)
diff --git a/Main/ResModule/ResManager.cs b/Main/ResModule/ResManager.cs
index 1e721fa..524efb3 100644
--- a/Main/ResModule/ResManager.cs
+++ b/Main/ResModule/ResManager.cs
@@ -234,6 +234,27 @@
LoadAssetAsyncInternal<T>(directory, name, callBack, needExt);
}
+ public async UniTask<T> LoadAssetAsync<T>(string directory, string name) where T : UnityEngine.Object
+ {
+ return await LoadAssetAsync<T>(directory, name, needExt: true);
+ }
+
+ public async UniTask<T> LoadAssetAsync<T>(string directory, string name, bool needExt = true) where T : UnityEngine.Object
+ {
+ var tcs = new UniTaskCompletionSource<T>();
+ LoadAssetAsync<T>(directory, name, (isLoaded, asset) => {
+ if (isLoaded)
+ {
+ tcs.TrySetResult(asset as T);
+ }
+ else
+ {
+ tcs.TrySetException(new Exception($"Failed to load asset: {directory}/{name}"));
+ }
+ }, needExt);
+ return await tcs.Task;
+ }
+
private void LoadSpriteAsync<T>(string atlasName, string spriteName, Action<bool, UnityEngine.Object> callBack) where T : UnityEngine.Object
{
if (!AssetSource.isUseAssetBundle)
diff --git a/Main/System/Battle/BattleEffectMgr.cs b/Main/System/Battle/BattleEffectMgr.cs
index 6e28f34..eb29191 100644
--- a/Main/System/Battle/BattleEffectMgr.cs
+++ b/Main/System/Battle/BattleEffectMgr.cs
@@ -132,7 +132,15 @@
if (effectDict.TryGetValue(effectId, out effectPlayers))
{
effectPlayers.Remove(effectPlayer);
- GameObject.DestroyImmediate(effectPlayer.gameObject);
+ if (null == effectPlayer)
+ {
+ BattleDebug.LogError("effect player is null, effectid : " + effectId);
+ return;
+ }
+ if (null != effectPlayer.gameObject)
+ {
+ GameObject.DestroyImmediate(effectPlayer.gameObject);
+ }
effectPlayer = null;
}
else
diff --git a/Main/System/Battle/BattleField/BattleField.cs b/Main/System/Battle/BattleField/BattleField.cs
index ea486e1..a670582 100644
--- a/Main/System/Battle/BattleField/BattleField.cs
+++ b/Main/System/Battle/BattleField/BattleField.cs
@@ -170,7 +170,7 @@
public virtual void Init(int _MapID, int _FuncLineID, JsonData _extendData,
List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList, byte _turnMax)
{
- SetData(_MapID, _FuncLineID, _extendData, _redTeamList, _blueTeamList, turnMax);
+ SetData(_MapID, _FuncLineID, _extendData, _redTeamList, _blueTeamList, _turnMax);
battleEffectMgr.Init(this);
battleTweenMgr.Init(this);
recordPlayer.Init(this);
diff --git a/Main/System/Battle/BattleObject/BattleObjectLayerMgr.cs b/Main/System/Battle/BattleObject/BattleObjectLayerMgr.cs
index 1db2927..ff98210 100644
--- a/Main/System/Battle/BattleObject/BattleObjectLayerMgr.cs
+++ b/Main/System/Battle/BattleObject/BattleObjectLayerMgr.cs
@@ -95,7 +95,7 @@
effectPlayers[i].SetActive(isFront);
}
// 绛栧垝瑕佸湪閲婃斁鎶�鑳界殑鏃跺�� 鍏朵粬瑙掕壊闅愯棌 杩欓噷鍦╞ack鐨勬椂鍊欏氨鐩存帴璁剧疆鎴�0 鍦ㄦ渶搴曚笅 鐪嬩笉鍒扮殑鍦版柟
- int baseOrder = isFront ? BattleConst.SkillMaskOrder : BattleConst.BattleBackgroundOrder;
+ int baseOrder = isFront ? BattleConst.SkillMaskOrder : BattleConst.BattleBackgroundOrder - BattleConst.BattleFrontHeroEffect;
SetSortingOrder(baseOrder);
}
diff --git a/Main/System/BeautyMM/BeautyMMManager.cs b/Main/System/BeautyMM/BeautyMMManager.cs
index 7fea852..b8781dc 100644
--- a/Main/System/BeautyMM/BeautyMMManager.cs
+++ b/Main/System/BeautyMM/BeautyMMManager.cs
@@ -237,22 +237,23 @@
public int GetUsedSkinID(int mmID)
{
+ var _list = BeautySkinConfig.GetSkinListByMMID(mmID);
if (beautyMMDataDict.ContainsKey(mmID))
{
var _beauty = beautyMMDataDict[mmID];
if (_beauty.State == 1)
{
- foreach (var skin in beautyMMSkinDataDict)
+ foreach (var skinCfg in _list)
{
- if (skin.Value.Used == 1)
+ beautyMMSkinDataDict.TryGetValue(skinCfg.SkinID, out BeautyMMSkinData skin);
+ if (skin != null && skin.Used == 1)
{
- return skin.Key;
+ return skinCfg.SkinID;
}
}
}
}
//榛樿绗竴涓�
- var _list = BeautySkinConfig.GetSkinListByMMID(mmID);
if (_list.Count > 0)
{
return _list[0].SkinID;
diff --git a/Main/System/BeautyMM/BeautyMMTravelWin.cs b/Main/System/BeautyMM/BeautyMMTravelWin.cs
index b4040da..c695d90 100644
--- a/Main/System/BeautyMM/BeautyMMTravelWin.cs
+++ b/Main/System/BeautyMM/BeautyMMTravelWin.cs
@@ -307,7 +307,7 @@
void AddEnergy()
{
- ItemLogicUtility.Instance.ShowItemBatchUseWin(BeautyMMManager.Instance.addEnergyItemID, ShowTip);
+ ItemLogicUtility.Instance.ShowItemBatchUseWin(BeautyMMManager.Instance.addEnergyItemID, ShowTip, Language.Get("GuildBoss22"));
}
string ShowTip(long useCnt)
diff --git a/Main/System/Chat/ChatBulletView.cs b/Main/System/Chat/ChatBulletView.cs
index e38c955..e15e123 100644
--- a/Main/System/Chat/ChatBulletView.cs
+++ b/Main/System/Chat/ChatBulletView.cs
@@ -61,6 +61,8 @@
fmlv = fairyMember.FmLV;
}
return Language.Get("Chat16", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name, data.Content);
+ case ChatChannel.CrossServer:
+ return Language.Get("Chat17", data.Name, data.Content);
default:
return data.Content;
}
diff --git a/Main/System/Chat/ChatManager.cs b/Main/System/Chat/ChatManager.cs
index b5bf315..ed795fd 100644
--- a/Main/System/Chat/ChatManager.cs
+++ b/Main/System/Chat/ChatManager.cs
@@ -115,7 +115,7 @@
{
talkDict.Clear();
lastTalkDataDict.Clear();
- currentDay = -1;
+ currentDayDict.Clear();
nowChatChannel = ChatChannel.World;
nowChatTab = ChatTab.World;
}
@@ -331,12 +331,12 @@
ChatReport(channelType, content);
}
- void ChatReport(int chatType, string content, string toPlayer="")
+ void ChatReport(int chatType, string content, string toPlayer = "")
{
try
{
var channelName = Language.Get($"ChatTab{chatType}");
-
+
OperationLogCollect.Instance.ChatReport(content, channelName, toPlayer, chatType);
}
catch (Exception e)
@@ -413,13 +413,19 @@
}
}
- public int currentDay = -1;
+ public Dictionary<ChatChannel, int> currentDayDict = new Dictionary<ChatChannel, int>();
public bool TryAddDate(int allSeconds, ChatChannel type, bool isSendBullet)
{
DateTime talkTime = TimeUtility.GetTime((uint)allSeconds);
- if (talkTime.Day != currentDay)
+ // 纭繚瀛楀吀涓寘鍚棰戦亾鐨勬潯鐩�
+ if (!currentDayDict.ContainsKey(type))
{
- currentDay = talkTime.Day;
+ currentDayDict[type] = -1;
+ }
+ // 姣忎釜棰戦亾鐙珛妫�鏌ユ棩鏈�
+ if (talkTime.Day != currentDayDict[type])
+ {
+ currentDayDict[type] = talkTime.Day;
AddTalkData(type, new TalkData()
{
ChannelType = (byte)type,
@@ -434,7 +440,7 @@
public void AddSysData(string msg, ArrayList infoList, ChatChannel type, bool isSendBullet)
{
- int allSeconds = TimeUtility.AllSeconds;
+ int allSeconds = type == ChatChannel.CrossServer ? TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) : TimeUtility.AllSeconds;
// 濡傛灉闅斿ぉ,澧炲姞鏃ユ湡琛�
TryAddDate(allSeconds, type, isSendBullet);
@@ -464,7 +470,7 @@
talkDict[type] = new List<TalkData>();
}
- int allSeconds = TimeUtility.AllSeconds;
+ int allSeconds = type == ChatChannel.CrossServer ? TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) : TimeUtility.AllSeconds;
// 濡傛灉闅斿ぉ,澧炲姞鏃ユ湡琛�
TryAddDate(allSeconds, type, true);
@@ -572,6 +578,7 @@
{
ChatTab.World,
ChatTab.Guild,
+ ChatTab.CrossServer,
// ChatTab.Person,
// ChatTab.BlackList,
};
@@ -583,8 +590,6 @@
switch (chatTab)
{
- case ChatTab.World:
- return true;
case ChatTab.Guild:
//娌℃湁鍏細
if (!PlayerDatas.Instance.fairyData.HasFairy)
@@ -594,8 +599,17 @@
return false;
}
return true;
+ case ChatTab.CrossServer:
+ //娌℃湁鍚堟湇
+ if (GuildManager.Instance.zoneID <= 0)
+ {
+ if (isTip)
+ SysNotifyMgr.Instance.ShowTip("CrossServerNoOpen");
+ return false;
+ }
+ return true;
default:
- return false;
+ return true;
}
}
@@ -697,8 +711,9 @@
{
World = 0, //涓栫晫
Guild = 1, //鍏細
- Person = 2, //绉佽亰
- BlackList = 3, //榛戝悕鍗�
+ CrossServer = 2, //璺ㄦ湇
+ Person = 3, //绉佽亰
+ BlackList = 4, //榛戝悕鍗�
}
public enum ChatChannel
{
diff --git a/Main/System/Chat/ChatPlayerMineCell.cs b/Main/System/Chat/ChatPlayerMineCell.cs
index 1830577..1613725 100644
--- a/Main/System/Chat/ChatPlayerMineCell.cs
+++ b/Main/System/Chat/ChatPlayerMineCell.cs
@@ -30,11 +30,16 @@
string serverName = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
m_PlayerName.text = Language.Get("Chat08", serverName, PlayerDatas.Instance.baseData.PlayerName);
}
- else
+ else if (manager.nowChatTab == ChatTab.Guild)
{
int fmlv = PlayerDatas.Instance.fairyData.mine.FmLV;
m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), PlayerDatas.Instance.baseData.PlayerName);
}
+ else if (manager.nowChatTab == ChatTab.CrossServer)
+ {
+ string serverName = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ m_PlayerName.text = Language.Get("Chat08", serverName, PlayerDatas.Instance.baseData.PlayerName);
+ }
}
public float GetHeight(string content, ArrayList list)
diff --git a/Main/System/Chat/ChatPlayerOtherCell.cs b/Main/System/Chat/ChatPlayerOtherCell.cs
index af20b9c..5aa1011 100644
--- a/Main/System/Chat/ChatPlayerOtherCell.cs
+++ b/Main/System/Chat/ChatPlayerOtherCell.cs
@@ -32,7 +32,7 @@
string serverName = ServerListCenter.Instance.GetServerName((int)data.ServerID);
m_PlayerName.text = Language.Get("Chat08", serverName, data.Name);
}
- else
+ else if (manager.nowChatTab == ChatTab.Guild)
{
FairyMember fairyMember = PlayerDatas.Instance.fairyData.GetMember((int)data.PlayerID);
int fmlv = 0;
@@ -42,7 +42,12 @@
}
m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name);
}
-
+ else if (manager.nowChatTab == ChatTab.CrossServer)
+ {
+ string serverName = ServerListCenter.Instance.GetServerName((int)data.ServerID);
+ m_PlayerName.text = Language.Get("Chat08", serverName, data.Name);
+ }
+
avatarCell.SetListener(() =>
{
AvatarHelper.TryViewOtherPlayerInfo((int)data.PlayerID, serverID: (int)data.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
diff --git a/Main/System/Chat/ChatWin.cs b/Main/System/Chat/ChatWin.cs
index 5e026dc..6b58dbc 100644
--- a/Main/System/Chat/ChatWin.cs
+++ b/Main/System/Chat/ChatWin.cs
@@ -22,7 +22,9 @@
[SerializeField] TextEx txtSendChat;
[SerializeField] ScrollerController scrWorld;
[SerializeField] ScrollerController scrGuild;
+ [SerializeField] ScrollerController scrCrossServer;
+ [SerializeField] ButtonEx serversBtn;
private int unreadMsgCount = 0;
[SerializeField] ButtonEx btnNewMsgTip;
[SerializeField] TextEx txtNewMsgTip;
@@ -32,6 +34,7 @@
bool isSettingOpen = false;
[SerializeField] ChatSettingButton btnWorldSetting;
[SerializeField] ChatSettingButton btnGuildSetting;
+ [SerializeField] ChatSettingButton btnCrossServerSetting;
ChatManager manager { get { return ChatManager.Instance; } }
protected override void InitComponent()
@@ -69,6 +72,11 @@
RefreshChat(manager.nowChatChannel, scrGuild);
ScrollerJump(scrGuild, ChatChannel.Guild);
}
+ else if (manager.nowChatChannel == ChatChannel.CrossServer)
+ {
+ RefreshChat(manager.nowChatChannel, scrCrossServer);
+ ScrollerJump(scrCrossServer, ChatChannel.CrossServer);
+ }
ClearUnreadMsg();
});
btnSetting.SetListener(() =>
@@ -76,7 +84,10 @@
isSettingOpen = !isSettingOpen;
transSettings.SetActive(isSettingOpen);
});
-
+ serversBtn.SetListener(() =>
+ {
+ UIHelper.ShowServersPanel(GuildManager.Instance.crossServerIDList);
+ });
}
// 娓呯悊鏈娑堟伅鐘舵��
@@ -104,12 +115,18 @@
manager.OnUpdatePlayerInfoEvent += OnUpdatePlayerInfoEvent;
scrChatTab.OnRefreshCell += OnRefreshChatTabCell;
+
scrWorld.OnGetDynamicSize += OnGetWorldChatDynamicSize;
scrWorld.OnRefreshCell += OnRefreshWorldCell;
scrWorld.mScrollRect.onValueChanged.AddListener(OnWorldScrollValChange);
+
scrGuild.OnGetDynamicSize += OnGetGuildChatDynamicSize;
scrGuild.OnRefreshCell += OnRefreshGuildCell;
scrGuild.mScrollRect.onValueChanged.AddListener(OnGuildScrollValChange);
+
+ scrCrossServer.OnGetDynamicSize += OnGetChatDynamicSize;
+ scrCrossServer.OnRefreshCell += OnRefreshCell;
+ scrCrossServer.mScrollRect.onValueChanged.AddListener(OnCrossServerScrollValChange);
clickScreenOtherSpace.AddListener(OnClickScreenOtherSpace);
GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
@@ -119,6 +136,7 @@
transSettings.SetActive(isSettingOpen);
btnWorldSetting.SetChannelType(ChatChannel.World);
btnGuildSetting.SetChannelType(ChatChannel.Guild);
+ btnCrossServerSetting.SetChannelType(ChatChannel.CrossServer);
inputChat.characterLimit = ChatManager.Instance.characterLimit;
CreaterAll(manager.nowChatTab);
}
@@ -139,9 +157,15 @@
scrWorld.OnGetDynamicSize -= OnGetWorldChatDynamicSize;
scrWorld.OnRefreshCell -= OnRefreshWorldCell;
scrWorld.mScrollRect.onValueChanged.RemoveListener(OnWorldScrollValChange);
+
scrGuild.OnGetDynamicSize -= OnGetGuildChatDynamicSize;
scrGuild.OnRefreshCell -= OnRefreshGuildCell;
scrGuild.mScrollRect.onValueChanged.RemoveListener(OnGuildScrollValChange);
+
+ scrCrossServer.OnGetDynamicSize -= OnGetChatDynamicSize;
+ scrCrossServer.OnRefreshCell -= OnRefreshCell;
+ scrCrossServer.mScrollRect.onValueChanged.RemoveListener(OnCrossServerScrollValChange);
+
GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
clickScreenOtherSpace.RemoveAllListeners();
}
@@ -165,6 +189,10 @@
else if (channel == ChatChannel.Guild)
{
CreateScroller(scrGuild, channel);
+ }
+ else if (channel == ChatChannel.CrossServer)
+ {
+ CreateScroller(scrCrossServer, channel);
}
}
@@ -227,7 +255,10 @@
{
if (scrWorld.lockType != EnhanceLockType.LockVerticalBottom)
scrWorld.lockType = EnhanceLockType.LockVerticalBottom;
-
+ if (scrGuild.lockType != EnhanceLockType.LockVerticalBottom)
+ scrGuild.lockType = EnhanceLockType.LockVerticalBottom;
+ if (scrCrossServer.lockType != EnhanceLockType.LockVerticalBottom)
+ scrCrossServer.lockType = EnhanceLockType.LockVerticalBottom;
// 濡傛灉鍥炲埌搴曢儴锛岀洿鎺ユ竻闆舵秷鎭�
ClearUnreadMsg();
}
@@ -236,6 +267,10 @@
{
if (scrWorld.lockType != EnhanceLockType.KeepVertical)
scrWorld.lockType = EnhanceLockType.KeepVertical;
+ if (scrGuild.lockType != EnhanceLockType.KeepVertical)
+ scrGuild.lockType = EnhanceLockType.KeepVertical;
+ if (scrCrossServer.lockType != EnhanceLockType.KeepVertical)
+ scrCrossServer.lockType = EnhanceLockType.KeepVertical;
}
}
}
@@ -248,6 +283,10 @@
private void OnGuildScrollValChange(Vector2 _pos)
{
OnScrollValChange(scrGuild, _pos);
+ }
+ private void OnCrossServerScrollValChange(Vector2 _pos)
+ {
+ OnScrollValChange(scrCrossServer, _pos);
}
private void OnScrollValChange(ScrollerController scorller, Vector2 _pos)
@@ -308,7 +347,11 @@
scrGuild.lockType = EnhanceLockType.LockVerticalBottom; // 鍒濆閿佸畾搴曢儴
scrGuild.SetActive(chatTab == ChatTab.Guild);
- transInput.SetActive(chatTab == ChatTab.World || chatTab == ChatTab.Guild);
+ scrCrossServer.lockType = EnhanceLockType.LockVerticalBottom; // 鍒濆閿佸畾搴曢儴
+ scrCrossServer.SetActive(chatTab == ChatTab.CrossServer);
+
+ transInput.SetActive(true);
+ serversBtn.SetActive(chatTab == ChatTab.CrossServer);
CreateChatTabScroller();
@@ -324,6 +367,12 @@
manager.nowChatChannel = ChatChannel.Guild;
CreateScroller(scrGuild, ChatChannel.Guild);
ScrollerJump(scrGuild, ChatChannel.Guild);
+ ClearUnreadMsg();
+ break;
+ case ChatTab.CrossServer:
+ manager.nowChatChannel = ChatChannel.CrossServer;
+ CreateScroller(scrCrossServer, ChatChannel.CrossServer);
+ ScrollerJump(scrCrossServer, ChatChannel.CrossServer);
ClearUnreadMsg();
break;
}
@@ -354,6 +403,10 @@
else if (type == ChatChannel.Guild)
{
RefreshChat(type, scrGuild, playerId, isUpdatePlayerInfo);
+ }
+ else if (type == ChatChannel.CrossServer)
+ {
+ RefreshChat(type, scrCrossServer, playerId, isUpdatePlayerInfo);
}
}
@@ -391,6 +444,8 @@
return;
if (type == ChatChannel.Guild && manager.nowChatTab != ChatTab.Guild)
return;
+ if (type == ChatChannel.CrossServer && manager.nowChatTab != ChatTab.CrossServer)
+ return;
// 1. 鑷繁鍙戦�佺殑娑堟伅 -> 寮哄埗璺宠浆鍒板簳閮� + 娓呴浂
if (playerId == PlayerDatas.Instance.PlayerId)
{
@@ -423,7 +478,7 @@
}
// 鐗规畩鎯呭喌锛氬鏋滄湭璇绘暟閲忓法澶э紙瓒呰繃浜嗘�绘樉绀烘暟閲忥級,璇存槑鏁翠釜鍒楄〃閮借鍒锋柊浜�,鐩存帴娑堥浂
- if (unreadMsgCount >= scrWorld.GetNumberOfCells(scrWorld.m_Scorller))
+ if (unreadMsgCount >= scroller.GetNumberOfCells(scroller.m_Scorller))
{
ClearUnreadMsg();
}
diff --git a/Main/System/Guild/GuildBossManager.cs b/Main/System/Guild/GuildBossManager.cs
index 01e3f73..4812420 100644
--- a/Main/System/Guild/GuildBossManager.cs
+++ b/Main/System/Guild/GuildBossManager.cs
@@ -100,12 +100,14 @@
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
GuildManager.Instance.EnterOrQuitGuildEvent += EnterOrQuitGuildEvent;
+ PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
ParseConfig();
}
public override void Release()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
GuildManager.Instance.EnterOrQuitGuildEvent -= EnterOrQuitGuildEvent;
+ PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo;
}
void OnBeforePlayerDataInitializeEventOnRelogin()
@@ -123,6 +125,10 @@
taofaPlayerData.Clear();
}
+ private void OnRefreshFairyInfo()
+ {
+ UpdateRedpoint();
+ }
void EnterOrQuitGuildEvent(bool isEnter)
{
diff --git a/Main/System/Guild/GuildBossWin.cs b/Main/System/Guild/GuildBossWin.cs
index f9fe965..656caba 100644
--- a/Main/System/Guild/GuildBossWin.cs
+++ b/Main/System/Guild/GuildBossWin.cs
@@ -298,6 +298,7 @@
//鏃堕棿鍒颁簡 瀹㈡埛绔嚜宸辨竻0
layerNum = 0;
}
+ layerNum = (uint)Math.Min(layerNum, GuildBossManager.Instance.bzMaxLevel);
var superHitRate = GuildBossManager.Instance.initSuperHitRate + (int)layerNum * GuildBossManager.Instance.bzAddAttrs[0];
var addHurtPer = (int)layerNum * GuildBossManager.Instance.bzAddAttrs[1];
diff --git a/Main/System/Guild/GuildManager.cs b/Main/System/Guild/GuildManager.cs
index 4366d50..c37afb5 100644
--- a/Main/System/Guild/GuildManager.cs
+++ b/Main/System/Guild/GuildManager.cs
@@ -64,6 +64,7 @@
private void OnRefreshFairyInfo()
{
UpdateRequestRedpoint();
+ UpdateDonateRedPoint();
}
void OnBeforePlayerDataInitialize()
@@ -77,6 +78,8 @@
void OnBeforePlayerDataInitializeEx()
{
isQueryZBGYet = false;
+ //澧為噺鐨勫舰寮�
+ PlayerDatas.Instance.fairyData.ClearData();
}
void OnPlayerLoginOk()
@@ -170,7 +173,24 @@
//鐝嶅疂闃�(琛屽晢)
- public int zhenbaogeCutState = 0;
+ int m_ZhenbaogeCutState = 0;
+ public int zhenbaogeCutState
+ {
+ get
+ {
+ if (familyZBGActions.Count - 1 >= 50)
+ {
+ //鐮嶄环浜烘暟瓒呰繃涓婇檺鍚庡彲鐩存帴璐拱
+ m_ZhenbaogeCutState = 1;
+ }
+ return m_ZhenbaogeCutState;
+ }
+ set
+ {
+
+ m_ZhenbaogeCutState = value;
+ }
+ }
public int zhenbaogeBuyState = 0;
public bool needCheckCutCD = false;
public event Action UpdateZhenbaogeEvent;
diff --git a/Main/System/HappyXB/HeroCallWin.cs b/Main/System/HappyXB/HeroCallWin.cs
index 5a1ff18..d5013b7 100644
--- a/Main/System/HappyXB/HeroCallWin.cs
+++ b/Main/System/HappyXB/HeroCallWin.cs
@@ -57,10 +57,11 @@
HappyXBModel.Instance.SendXBManyQuest((int)HappXBTitle.HeroCallAdvanced);
});
});
- scoreBtn.AddListener(() =>
- {
- UIManager.Instance.OpenWindow<HeroCallScoreWin>();
- });
+ //绛栧垝鏀瑰彉闇�姹� 鏆傛椂鍏抽棴
+ // scoreBtn.AddListener(() =>
+ // {
+ // UIManager.Instance.OpenWindow<HeroCallScoreWin>();
+ // });
ruleBtn.AddListener(() =>
{
diff --git a/Main/System/Hero/UIHeroController.cs b/Main/System/Hero/UIHeroController.cs
index c60a66c..0d72b60 100644
--- a/Main/System/Hero/UIHeroController.cs
+++ b/Main/System/Hero/UIHeroController.cs
@@ -1,6 +1,7 @@
using System;
using Cysharp.Threading.Tasks;
+using Spine;
using Spine.Unity;
using UnityEngine;
using UnityEngine.UI;
@@ -11,7 +12,7 @@
private int skinID;
protected SkeletonGraphic skeletonGraphic;
- protected Spine.AnimationState spineAnimationState;
+ public Spine.AnimationState spineAnimationState;
private GameObject instanceGO;
public Action onComplete;
@@ -27,7 +28,7 @@
if (isLh)
{
var skinConfigTmp = HeroSkinConfig.Get(skinID);
- if (skinConfigTmp != null && skinConfigTmp.Tachie.Contains("SkeletonData"))
+ if (skinConfigTmp != null && skinConfigTmp.Tachie.IsSpine())
{
skeletonGraphic.enabled = true;
}
@@ -61,7 +62,7 @@
//绔嬬粯鐗规畩澶勭悊锛屾病鏈塻pine鍔ㄧ敾鐨勬敼鐢ㄥ浘鐗�
var lhImg = this.AddMissingComponent<RawImage>();
- if (!skinConfig.Tachie.Contains("SkeletonData"))
+ if (!skinConfig.Tachie.IsSpine())
{
//鍥剧墖鏇挎崲
lhImg.SetTexture2DPNG(skinConfig.Tachie);
@@ -289,6 +290,10 @@
}
+ public bool HasAnimation(string motionName)
+ {
+ return skeletonGraphic != null && skeletonGraphic.Skeleton != null && skeletonGraphic.Skeleton.ContainsMotion(motionName);
+ }
protected void OnDestroy()
@@ -309,15 +314,15 @@
/// <param name="motionName">鍔ㄤ綔鍚�</param>
/// <param name="loop">寰幆</param>
/// <param name="replay">濡傛灉鐩稿悓鍔ㄤ綔鏄惁鍐嶆閲嶆挱锛屾瘮濡傝窇姝ラ噸鎾氨浼氳烦甯т笉椤烘粦</param>
- public virtual void PlayAnimation(string motionName, bool loop = false, bool replay = true)
+ public virtual TrackEntry PlayAnimation(string motionName, bool loop = false, bool replay = true)
{
- if (spineAnimationState == null) return;
+ if (spineAnimationState == null) return null;
if (GetCurrentAnimationName() == motionName && !replay)
- return;
+ return null;
// 鐩存帴浣跨敤 ToString() 鑰屼笉鏄皟鐢� GetAnimationName
- spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
+ return spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
}
// 鎾斁绗竴涓姩鐢伙紙浣滀负榛樿鍔ㄧ敾锛�
diff --git a/Main/System/ItemTip/ItemBatchUseWin.cs b/Main/System/ItemTip/ItemBatchUseWin.cs
index b5ee930..daf0a4e 100644
--- a/Main/System/ItemTip/ItemBatchUseWin.cs
+++ b/Main/System/ItemTip/ItemBatchUseWin.cs
@@ -8,29 +8,38 @@
public class ItemBatchUseWin : UIBase
{
[SerializeField] ItemCell itemCell;
- [SerializeField] Text itemCntTxt;
- [SerializeField] LongPressButton subBtn;
- [SerializeField] LongPressButton addBtn;
+ [SerializeField] Text nameText;
+ [SerializeField] Text countText;
+ [SerializeField] Text descText;
+ [SerializeField] SliderPanel sliderPanel;
[SerializeField] Text tipText;
[SerializeField] Button okBtn;
+ [SerializeField] Text btnNameText;
[SerializeField] Text titleText;
public static Func<long, string> ShowTextEvent;
public static int itemID;
- long curUseCount;
- long maxCount;
+ public static string btnName;
+
+ int useCnt;
+ long maxCnt;
protected override void InitComponent()
{
- addBtn.SetListener(OnClickPlus);
- addBtn.onPress.AddListener(OnClickPlus);
- subBtn.SetListener(OnClickReduce);
- subBtn.onPress.AddListener(OnClickReduce);
okBtn.AddListener(OnOK);
}
+
+
protected override void OnPreOpen()
{
+ useCnt = 1;
+ Display();
+ }
+
+ void Display()
+ {
+
var key = "UseItemTitle_" + itemID;
if (LanguageConfig.HasKey(key))
{
@@ -40,32 +49,36 @@
{
titleText.text = Language.Get("UseItemDefault");
}
- maxCount = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
- curUseCount = maxCount > 0 ? 1 : 0;
- itemCell.Init(new ItemCellModel(itemID, false, curUseCount));
+ maxCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
+ useCnt = maxCnt > 0 ? 1 : 0;
+ itemCell.Init(new ItemCellModel(itemID, false, useCnt));
itemCell.button.AddListener(() =>
{
ItemTipUtility.Show(itemID);
});
- RefreshCount();
- RefreshBtn();
+
+ var itemConfig = ItemConfig.Get(itemID);
+ nameText.text = itemConfig.ItemName;
+ countText.text = Language.Get("storename12", maxCnt);
+ descText.text = itemConfig.Description;
+
+
+
+ OnSliderChange(useCnt);
+ sliderPanel.Init((value) => { OnSliderChange(value); }, (int)maxCnt);
+
+ btnNameText.text = btnName;
}
- protected override void OnPreClose()
+ void OnSliderChange(int value)
{
- }
+ useCnt = value;
+ itemCell.countText.text = UIHelper.ReplaceLargeNum(useCnt);
-
-
-
- void RefreshCount()
- {
- itemCntTxt.text = curUseCount + "/" + maxCount;
- itemCell.countText.text = curUseCount.ToString();
if (ShowTextEvent != null)
{
- tipText.text = ShowTextEvent(curUseCount);
+ tipText.text = ShowTextEvent(useCnt);
}
else
{
@@ -74,66 +87,21 @@
}
- void RefreshBtn()
- {
- if (curUseCount >= maxCount)
- {
- addBtn.interactable = false;
- addBtn.SetColorful(null, false);
- }
- else
- {
- addBtn.interactable = true;
- addBtn.SetColorful(null, true);
- }
-
- if (curUseCount == 0)
- {
- subBtn.interactable = false;
- subBtn.SetColorful(null, false);
- }
- else
- {
- subBtn.interactable = true;
- subBtn.SetColorful(null, true);
- }
- }
-
-
- void OnClickPlus()
- {
- if (curUseCount >= maxCount)
- {
- curUseCount = maxCount;
- return;
- }
- curUseCount++;
- RefreshCount();
- RefreshBtn();
- }
-
- void OnClickReduce()
- {
- if (curUseCount == 0)
- return;
-
- curUseCount--;
- RefreshCount();
- RefreshBtn();
- }
void OnOK()
{
CloseWindow();
- if (curUseCount == 0)
+ if (useCnt == 0)
{
SysNotifyMgr.Instance.ShowTip("UseItem1");
return;
}
- if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, curUseCount, 2))
+ if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, useCnt, 1))
{
- ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID), (int)curUseCount);
+ ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID), useCnt);
}
+
+ SysNotifyMgr.Instance.ShowTip("UseOK");
}
}
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
index dbc172c..696d42a 100644
--- a/Main/System/KnapSack/Logic/ItemLogicUtility.cs
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -292,18 +292,20 @@
/// </summary>
/// <param name="itemID">瑕佷娇鐢ㄧ殑鐗╁搧</param>
/// <param name="showTipEvent">鍙傛暟涓鸿浣跨敤鐨勭墿鍝佹暟閲忥紝杩斿洖鍊间负鏂囨湰</param>
- public void ShowItemBatchUseWin(int itemID, Func<long, string> showTipEvent)
+ public void ShowItemBatchUseWin(int itemID, Func<long, string> showTipEvent, string btnName)
{
if (UIManager.Instance.IsOpened<ItemBatchUseWin>())
{
UIManager.Instance.CloseWindow<ItemBatchUseWin>();
}
- if (!CheckItemCount(PackType.Item, itemID, 1, 2))
+ //鎻愮ず绫诲瀷鍚庣画鏈夊彉鍖栵紝瑕佺害瀹氫笅濡備綍鎻愮ず
+ if (!CheckItemCount(PackType.Item, itemID, 1, 1))
{
return;
}
ItemBatchUseWin.itemID = itemID;
ItemBatchUseWin.ShowTextEvent = showTipEvent;
+ ItemBatchUseWin.btnName = btnName;
UIManager.Instance.OpenWindow<ItemBatchUseWin>();
}
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index e102de8..da47121 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()
@@ -365,6 +374,10 @@
case ChatChannel.Guild:
ChatManager.Instance.nowChatTab = ChatTab.Guild;
ChatManager.Instance.nowChatChannel = ChatChannel.Guild;
+ break;
+ case ChatChannel.CrossServer:
+ ChatManager.Instance.nowChatTab = ChatTab.CrossServer;
+ ChatManager.Instance.nowChatChannel = ChatChannel.CrossServer;
break;
}
}
@@ -794,6 +807,10 @@
{
timingGiftCell.InitUI();
}
+ else if (funcId == (int)FuncOpenEnum.TimeRush)
+ {
+ DisplayTimeRush();
+ }
}
private void OnUpdateFirstChargeInfo()
@@ -848,6 +865,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..68e12f2
--- /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.LightGreen, 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..32e850c
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushManager.cs
@@ -0,0 +1,522 @@
+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 event Action OnNewAwardHaveEvent;
+ 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 (!UIManager.Instance.IsOpened<TimeRushTipWin>())
+ {
+ UIManager.Instance.OpenWindow<TimeRushTipWin>();
+ }
+ OnNewAwardHaveEvent?.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..18dac4a
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTaskCell.cs
@@ -0,0 +1,136 @@
+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] 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/TimeRushTipWin.cs b/Main/System/TimeRush/TimeRushTipWin.cs
new file mode 100644
index 0000000..129df72
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTipWin.cs
@@ -0,0 +1,140 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TimeRushTipWin : UIBase
+{
+ [SerializeField] RectTransform tip;
+ [SerializeField] ButtonEx clickBtn;
+ [SerializeField] TextEx awardTipText;
+ [SerializeField] List<ItemCell> itemCells = new List<ItemCell>();
+ [SerializeField] PositionTween positionTween;
+ [SerializeField] float waitTime = 3.0f;
+ [SerializeField] float moveDurationTime = 1.0f; // 绉诲姩鎸佺画鏃堕棿
+ [SerializeField] RectTransform startPos; // 鍒濆浣嶇疆
+ [SerializeField] RectTransform downPos; // 寰�涓嬬Щ鍔ㄤ綅缃�
+ [SerializeField] RectTransform upPos; // 寰�涓婄Щ鍔ㄤ綅缃�
+
+ int roundType;
+ int awardType;
+ int awardTypeValue;
+ int awardIndex;
+ float openTime;
+
+ private enum MoveState
+ {
+ MovingDown,
+ Staying,
+ MovingUp,
+ Finished
+ }
+
+ MoveState currentState;
+ TimeRushManager manager { get { return TimeRushManager.Instance; } }
+
+ protected override void InitComponent()
+ {
+ clickBtn.SetListener(() =>
+ {
+ if (UIManager.Instance.IsOpened<TimeRushWin>())
+ {
+ UIManager.Instance.CloseWindow<TimeRushWin>();
+ }
+ var list = manager.GetTabIDList();
+ if (list.IsNullOrEmpty())
+ return;
+ if (!ActLunhuidianTypeConfig.TryGetConfig(roundType, 1, out var config) || !list.Contains(config.ID))
+ return;
+ UIManager.Instance.OpenWindow<TimeRushWin>(config.ID);
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ manager.OnNewAwardHaveEvent += OnNewAwardHaveEvent;
+ ResetAnimation();
+ }
+
+ protected override void OnPreClose()
+ {
+ manager.OnNewAwardHaveEvent -= OnNewAwardHaveEvent;
+ }
+
+ void LateUpdate()
+ {
+
+ if (currentState == MoveState.Staying)
+ {
+ if (Time.time - openTime > waitTime)
+ {
+ currentState = MoveState.MovingUp;
+ positionTween.reversal = true;
+ positionTween.from = downPos.anchoredPosition;
+ positionTween.to = upPos.anchoredPosition;
+ positionTween.duration = moveDurationTime;
+ positionTween.Play(OnMoveUpComplete);
+ }
+ }
+ }
+
+ private void OnMoveDownComplete()
+ {
+ currentState = MoveState.Staying;
+ openTime = Time.time;
+ }
+
+ private void OnMoveUpComplete()
+ {
+ currentState = MoveState.Finished;
+ if (UIManager.Instance.IsOpened<TimeRushTipWin>())
+ {
+ UIManager.Instance.CloseWindow<TimeRushTipWin>();
+ }
+ }
+
+ private void Display()
+ {
+ roundType = manager.newRoundType;
+ awardType = manager.newAwardType;
+ awardTypeValue = manager.newAwardTypeValue;
+ awardIndex = manager.newAwardIndex;
+
+
+ if (!manager.TryGetOperationInfo(out var act) || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var award, out int listIndex) || award.AwardItemList == null)
+ return;
+
+ awardTipText.text = Language.Get($"TimeRushTaskTitle_{awardType}_{awardTypeValue}", award.NeedValue);
+
+ for (int i = 0; i < itemCells.Count; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < award.AwardItemList.Length)
+ {
+ var itemInfo = award.AwardItemList[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel((int)itemInfo.ItemID, false, itemInfo.ItemCount));
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+
+ private void OnNewAwardHaveEvent()
+ {
+ ResetAnimation();
+ }
+
+ private void ResetAnimation()
+ {
+ currentState = MoveState.MovingDown;
+ openTime = Time.time;
+ tip.anchoredPosition = startPos.anchoredPosition;
+ positionTween.reversal = false;
+ positionTween.from = startPos.anchoredPosition;
+ positionTween.to = downPos.anchoredPosition;
+ positionTween.duration = moveDurationTime;
+ positionTween.Play(OnMoveDownComplete);
+ Display();
+ }
+}
diff --git a/Main/System/TimeRush/TimeRushTipWin.cs.meta b/Main/System/TimeRush/TimeRushTipWin.cs.meta
new file mode 100644
index 0000000..0a032c9
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushTipWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f5d65c473483e9a468f8c7a9866199ba
+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..5926123
--- /dev/null
+++ b/Main/System/TimeRush/TimeRushWin.cs
@@ -0,0 +1,301 @@
+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)
+ {
+ var list = manager.GetTabIDList();
+ if (list.IsNullOrEmpty())
+ {
+ DelayCloseWindow().Forget();
+ return;
+ }
+ manager.nowTabId = list[0];
+ CreateAll();
+ }
+ }
+
+ 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;
+ Display(id);
+ tabScroller.m_Scorller.RefreshActiveCellViews();
+
+ taskScroller.SetActive(tabType == 1);
+ giftScroller.SetActive(tabType == 2);
+
+ if (tabType == 1)
+ {
+ CreateTaskScroller(roundType, tabType);
+ return;
+ }
+
+ if (tabType == 2)
+ {
+ giftScroller.m_Scorller.RefreshActiveCellViews();
+ return;
+ }
+
+ }
+
+ 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/System/TimingGift/TimingGiftManager.cs b/Main/System/TimingGift/TimingGiftManager.cs
index 220ffcc..d7b2483 100644
--- a/Main/System/TimingGift/TimingGiftManager.cs
+++ b/Main/System/TimingGift/TimingGiftManager.cs
@@ -37,6 +37,10 @@
public int[] selectCtgIds;
public int[][] selectGainItemList;
+ public int limitPopCnt;
+ public int limitShowCnt;
+ public int limitPopCd;
+
public event Action OnSelectCtgIdIndexChangeEvent;
public bool isLogShow = true;
@@ -45,6 +49,11 @@
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+
+ var config = FuncConfigConfig.Get("TimingGift");
+ limitPopCnt = int.Parse(config.Numerical1);
+ limitShowCnt = int.Parse(config.Numerical2);
+ limitPopCd = int.Parse(config.Numerical3);
}
public override void Release()
@@ -165,9 +174,55 @@
return showGiftIdList;
}
+ HashSet<int> typeHashSet;
+ int GetShowCnt()
+ {
+ if (typeHashSet == null)
+ typeHashSet = new HashSet<int>();
+
+ typeHashSet.Clear();
+ if (showGiftIdList.IsNullOrEmpty())
+ return 0;
+
+ for (int i = 0; i < showGiftIdList.Count; i++)
+ {
+ int id = showGiftIdList[i];
+ if (!TimingGiftConfig.TryGetTimingGiftConfig(id, out var config))
+ continue;
+ typeHashSet.Add(config.GiftType);
+ }
+ return typeHashSet.Count;
+ }
+
+ int GetPopCnt()
+ {
+ if (lastTriggerTimeDict.IsNullOrEmpty())
+ return 0;
+ int cnt = 0;
+ foreach (var item in lastTriggerTimeDict)
+ {
+ int type = item.Key;
+ int time = item.Value;
+ var timeData = TimeUtility.GetTime((uint)time);
+ DateTime nowTime = TimeUtility.ServerNow;
+ if (timeData.Day == nowTime.Day && timeData.Month == nowTime.Month && timeData.Year == nowTime.Year)
+ {
+ cnt += 1;
+ }
+ }
+ return cnt;
+ }
+
+ bool IsInLimitCd()
+ {
+ if (lastTriggerTimeDict.IsNullOrEmpty())
+ return false;
+ int lastTime = lastTriggerTimeDict.Values.Max();
+ return TimeUtility.AllSeconds - lastTime <= limitPopCd;
+ }
+
public void TryAdd(int type)
{
-
if (NewBieCenter.Instance.inGuiding)
{
#if UNITY_EDITOR
@@ -191,25 +246,60 @@
return;
}
- if (!IsTodayUnlimited(type))
- {
-#if UNITY_EDITOR
- if (isLogShow)
- {
- int lastTriggerTime = lastTriggerTimeDict[type];
- DateTime lastTime = TimeUtility.GetTime((uint)lastTriggerTime);
- Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,浠婂ぉ宸插脊鍑鸿繃{type}绫诲瀷鐨勭ぜ鍖咃紝璇ョ被鍨嬩笂娆″脊鍑烘椂闂翠负{lastTime:yyyy-MM-dd HH:mm:ss}");
- }
-#endif
- return;
- }
-
if (!TimingGiftConfig.TryGetTypeToGiftIdList(type, out List<int> giftIdList))
{
#if UNITY_EDITOR
if (isLogShow)
{
Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,琛ㄦ牸涓病鏈夋壘鍒皗type}绫诲瀷鐨勭ぜ鍖匢D");
+ }
+#endif
+ return;
+ }
+ int showCnt = GetShowCnt();
+
+ if (limitShowCnt <= showCnt)
+ {
+#if UNITY_EDITOR
+ if (isLogShow)
+ {
+ Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,褰撳墠宸茶揪鍒板悓鏃跺睍绀虹殑绀煎寘绫诲瀷鏁伴噺鎬讳笂闄�");
+ }
+#endif
+ return;
+ }
+ int popCnt = GetPopCnt();
+
+ if (limitPopCnt <= popCnt)
+ {
+#if UNITY_EDITOR
+ if (isLogShow)
+ {
+ Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,浠婃棩宸茶揪鍒扮ぜ鍖呯被鍨嬭Е鍙戞暟閲忔�讳笂闄�");
+ }
+#endif
+ return;
+ }
+
+ bool isInLimitCd = IsInLimitCd();
+ if (isInLimitCd)
+ {
+#if UNITY_EDITOR
+ if (isLogShow)
+ {
+ Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,绀煎寘瑙﹀彂鍐峰嵈鏃堕棿涓�");
+ }
+#endif
+ return;
+ }
+
+ if (!IsTodayUnlimited(type))
+ {
+#if UNITY_EDITOR
+ if (isLogShow)
+ {
+ int lastTriggerTime = lastTriggerTimeDict[type];
+ Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,浠婂ぉ宸插脊鍑鸿繃{type}绫诲瀷鐨勭ぜ鍖咃紝璇ョ被鍨嬩笂娆″脊鍑烘椂闂翠负{TimeUtility.GetTime((uint)lastTriggerTime):yyyy-MM-dd HH:mm:ss}");
}
#endif
return;
@@ -225,7 +315,7 @@
continue;
isChange = true;
showGiftIdList.Add(id);
- lastTriggerTimeDict[id] = TimeUtility.AllSeconds;
+ lastTriggerTimeDict[config.GiftType] = TimeUtility.AllSeconds;
}
if (isChange)
@@ -480,7 +570,7 @@
lastTriggerTimeDict = loadDict;
InitCurrectTimingGiftIdList(new List<int>(loadDict.Keys));
-
+
#if UNITY_EDITOR
if (isLogShow)
{
diff --git a/Main/System/TimingGift/TimingGiftWin.cs b/Main/System/TimingGift/TimingGiftWin.cs
index 6444fbe..8ddc17d 100644
--- a/Main/System/TimingGift/TimingGiftWin.cs
+++ b/Main/System/TimingGift/TimingGiftWin.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using UnityEngine;
+using UnityEngine.UI;
public class TimingGiftWin : UIBase
{
@@ -10,7 +11,7 @@
[SerializeField] TimingGiftCtgIdCell[] ctgIdCells;
[SerializeField] TextEx timeText;
- [SerializeField] ImageEx bgImage;
+ [SerializeField] RawImage bgImage;
[SerializeField] ImageEx IconImage;
[SerializeField] GradientText giftText; //"绀煎寘"
[SerializeField] OutlineEx giftTextOutline;
@@ -238,7 +239,7 @@
leftButton.SetActive(isShowSwitch);
rightButton.SetActive(isShowSwitch);
- bgImage.SetSprite($"TimingGiftBg_{manager.selectTabGiftId}");
+ bgImage.SetTexture2DPNG(IconConfig.Get($"TimingGiftBg_{manager.selectTabGiftId}").sprite);
bgImage.SetNativeSize();
IconImage.SetSprite($"TimingGiftIcon_{manager.selectTabGiftId}");
IconImage.SetNativeSize();
diff --git a/Main/System/Video.meta b/Main/System/Video.meta
new file mode 100644
index 0000000..bf20a4e
--- /dev/null
+++ b/Main/System/Video.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9f8b60fd5cb8de143a61b1a3ea0fc728
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Video/UIVideoPlayer.cs b/Main/System/Video/UIVideoPlayer.cs
new file mode 100644
index 0000000..1b005b2
--- /dev/null
+++ b/Main/System/Video/UIVideoPlayer.cs
@@ -0,0 +1,505 @@
+using System;
+using UnityEngine;
+using UnityEngine.Video;
+using UnityEngine.UI;
+
+/// <summary>
+/// UI瑙嗛鎾斁鍣ㄧ粍浠� - 鏀寔WebM鏍煎紡閫忔槑瑙嗛鎾斁
+/// </summary>
+public class UIVideoPlayer : MonoBehaviour
+{
+ [Header("缁勪欢寮曠敤")]
+ public VideoPlayer videoPlayer;
+ public RawImage videoImage;
+
+ [Header("璋冭瘯淇℃伅")]
+ public const string directory = "Video";
+ public string videoName;
+ public bool isLoop = false;
+
+ [Header("璧勬簮绠$悊")]
+ [Tooltip("鎾斁瀹屾垚鍚庢槸鍚﹁嚜鍔ㄥ嵏杞借祫婧愶紙浠呭綋闈炲惊鐜挱鏀炬椂鏈夋晥锛�")]
+ public bool autoUnloadOnFinish = true;
+
+ [Header("鍥炶皟浜嬩欢")]
+ public Action onComplete;
+ public Action onPrepared;
+
+ private RenderTexture _renderTexture;
+ private VideoClip _loadedClip;
+ private bool _isPrepared;
+ private bool _isLoading;
+ private Action<bool> _onPrepareCallback;
+
+ #region Public API
+
+ /// <summary>
+ /// 鍔犺浇骞舵挱鏀捐棰戯紙閫氳繃璧勬簮绯荤粺鍔犺浇 VideoClip锛�
+ /// </summary>
+ /// <param name="_videoName">瑙嗛鏂囦欢鍚嶏紙涓嶅惈鎵╁睍鍚嶏級</param>
+ /// <param name="_loop">鏄惁寰幆鎾斁</param>
+ /// <param name="_onComplete">鎾斁瀹屾垚鍥炶皟锛堜粎鍦ㄩ潪寰幆鎾斁鏃惰皟鐢級</param>
+ public async void LoadAndPlayVideo(string _videoName, bool _loop = false, Action _onComplete = null)
+ {
+ if (!ValidateComponents()) return;
+ if (_isLoading)
+ {
+ Debug.LogWarning($"UIVideoPlayer: Already loading video. Please wait.");
+ return;
+ }
+
+ videoName = _videoName;
+ isLoop = _loop;
+ onComplete = _onComplete;
+ _isPrepared = false;
+ _isLoading = true;
+
+ // 娓呯悊鏃ц祫婧�
+ ReleaseRenderTexture();
+
+ // 闅愯棌鎴栬缃┖鐘舵�侀鑹�
+ SetEmptyState();
+
+ // 閫氳繃 ResManager 鍔犺浇 VideoClip 璧勬簮锛堟敮鎸� AB 鎵撳寘锛�
+ _loadedClip = await ResManager.Instance.LoadAssetAsync<VideoClip>(directory, videoName, false);
+
+ // 妫�鏌ユ槸鍚﹀湪鍔犺浇杩囩▼涓鍙栨秷
+ if (!_isLoading)
+ {
+ _loadedClip = null;
+ return;
+ }
+
+ _isLoading = false;
+
+ if (_loadedClip == null)
+ {
+ Debug.LogError($"UIVideoPlayer: Failed to load VideoClip: {directory}/{videoName}");
+ _isPrepared = false;
+ return;
+ }
+
+ // 鍒涘缓骞剁粦瀹� RenderTexture锛堟寜瑙嗛瀹為檯灏哄锛�
+ _renderTexture = new RenderTexture((int)_loadedClip.width, (int)_loadedClip.height, 0);
+ videoPlayer.targetTexture = _renderTexture;
+ videoImage.texture = _renderTexture;
+ videoImage.SetNativeSize();
+
+
+ // 鏄剧ず瑙嗛
+ SetActiveState();
+
+ videoPlayer.source = VideoSource.VideoClip;
+ videoPlayer.clip = _loadedClip;
+ videoPlayer.isLooping = isLoop;
+ videoPlayer.prepareCompleted += OnVideoPrepared;
+
+ // 闈炲惊鐜挱鏀炬椂娉ㄥ唽瀹屾垚浜嬩欢
+ if (!isLoop)
+ {
+ videoPlayer.loopPointReached += OnVideoFinished;
+ }
+
+ videoPlayer.Prepare();
+ }
+
+ /// <summary>
+ /// 鍔犺浇骞舵挱鏀炬寚瀹氳棰�
+ /// </summary>
+ public void LoadAndPlay(string videoName, bool loop = false, Action onCompleteCallback = null)
+ {
+ LoadAndPlayVideo(videoName, loop, onCompleteCallback);
+ }
+
+ [ContextMenu("鎾斁")]
+ public void Play()
+ {
+ if (!ValidateComponents()) return;
+ if (_isPrepared && !videoPlayer.isPlaying)
+ {
+ videoPlayer.Play();
+ }
+ }
+
+ [ContextMenu("鏆傚仠")]
+ public void Pause()
+ {
+ if (!ValidateComponents()) return;
+ if (videoPlayer.isPlaying)
+ {
+ videoPlayer.Pause();
+ }
+ }
+
+ [ContextMenu("鎭㈠")]
+ public void Resume()
+ {
+ if (!ValidateComponents()) return;
+ if (_isPrepared && !videoPlayer.isPlaying)
+ {
+ videoPlayer.Play();
+ }
+ }
+
+ /// <summary>
+ /// 棰勫姞杞借棰戯紙涓嶈嚜鍔ㄦ挱鏀撅級
+ /// </summary>
+ /// <param name="_videoName">瑙嗛鏂囦欢鍚嶏紙涓嶅惈鎵╁睍鍚嶏級</param>
+ /// <param name="onPreparedOK">棰勫姞杞藉畬鎴愬洖璋冿紝鍙傛暟涓烘槸鍚︽垚鍔�</param>
+ public async void Prepare(string _videoName, Action<bool> onPreparedOK)
+ {
+ if (!ValidateComponents())
+ {
+ onPreparedOK?.Invoke(false);
+ return;
+ }
+
+ if (_isLoading)
+ {
+ Debug.LogWarning($"UIVideoPlayer: Already loading video. Please wait.");
+ onPreparedOK?.Invoke(false);
+ return;
+ }
+
+ videoName = _videoName;
+ _onPrepareCallback = onPreparedOK;
+ _isPrepared = false;
+ _isLoading = true;
+
+ // 娓呯悊鏃ц祫婧�
+ ReleaseRenderTexture();
+ SetEmptyState();
+
+ // 閫氳繃 ResManager 鍔犺浇 VideoClip 璧勬簮锛堟敮鎸� AB 鎵撳寘锛�
+ _loadedClip = await ResManager.Instance.LoadAssetAsync<VideoClip>(directory, videoName, false);
+
+ // 妫�鏌ユ槸鍚﹀湪鍔犺浇杩囩▼涓鍙栨秷
+ if (!_isLoading)
+ {
+ _loadedClip = null;
+ return;
+ }
+
+ _isLoading = false;
+
+ if (_loadedClip == null)
+ {
+ Debug.LogError($"UIVideoPlayer: Failed to load VideoClip: {directory}/{videoName}");
+ _isPrepared = false;
+ _onPrepareCallback?.Invoke(false);
+ _onPrepareCallback = null;
+ return;
+ }
+
+ // 鍒涘缓骞剁粦瀹� RenderTexture锛堟寜瑙嗛瀹為檯灏哄锛�
+ _renderTexture = new RenderTexture((int)_loadedClip.width, (int)_loadedClip.height, 0);
+ videoPlayer.targetTexture = _renderTexture;
+ videoImage.texture = _renderTexture;
+ videoImage.SetNativeSize();
+
+ SetActiveState();
+
+ videoPlayer.source = VideoSource.VideoClip;
+ videoPlayer.clip = _loadedClip;
+ videoPlayer.prepareCompleted += OnVideoPreparedForPreload;
+
+ videoPlayer.Prepare();
+ }
+
+ /// <summary>
+ /// 閫氳繃 URL 鍔犺浇骞舵挱鏀捐棰�
+ /// </summary>
+ /// <param name="url">瑙嗛 URL 鍦板潃</param>
+ /// <param name="_loop">鏄惁寰幆鎾斁</param>
+ /// <param name="_onComplete">鎾斁瀹屾垚鍥炶皟锛堜粎鍦ㄩ潪寰幆鎾斁鏃惰皟鐢級</param>
+ public void LoadAndPlayFromURL(string url, bool _loop = false, Action _onComplete = null)
+ {
+ if (!ValidateComponents()) return;
+ if (_isLoading)
+ {
+ Debug.LogWarning($"UIVideoPlayer: Already loading video. Please wait.");
+ return;
+ }
+
+ videoName = url;
+ isLoop = _loop;
+ onComplete = _onComplete;
+ _isPrepared = false;
+ _isLoading = true;
+
+ // 娓呯悊鏃ц祫婧�
+ ReleaseRenderTexture();
+ SetEmptyState();
+
+ // 鏍规嵁 URL 瑙嗛鍒涘缓榛樿灏哄鐨� RenderTexture锛堝噯澶囧畬鎴愬悗浼氳皟鏁达級
+ _renderTexture = new RenderTexture(1920, 1080, 0);
+ videoPlayer.targetTexture = _renderTexture;
+ videoImage.texture = _renderTexture;
+
+ SetActiveState();
+
+ videoPlayer.source = VideoSource.Url;
+ videoPlayer.url = url;
+ videoPlayer.isLooping = isLoop;
+ videoPlayer.prepareCompleted += OnVideoPreparedForURL;
+
+ // 闈炲惊鐜挱鏀炬椂娉ㄥ唽瀹屾垚浜嬩欢
+ if (!isLoop)
+ {
+ videoPlayer.loopPointReached += OnVideoFinished;
+ }
+
+ videoPlayer.Prepare();
+ }
+
+ [ContextMenu("鍋滄")]
+ public void Stop()
+ {
+ if (!ValidateComponents()) return;
+ videoPlayer.Stop();
+ }
+
+ [ContextMenu("閲嶆柊鎾斁")]
+ public void Restart()
+ {
+ if (!ValidateComponents()) return;
+ if (_isPrepared)
+ {
+ videoPlayer.Stop();
+ videoPlayer.Play();
+ }
+ }
+
+ /// <summary>
+ /// 鍗歌浇瑙嗛璧勬簮
+ /// </summary>
+ public void Unload()
+ {
+ if (videoPlayer == null) return;
+
+ // 鍙栨秷鎵�鏈変簨浠惰闃�
+ videoPlayer.prepareCompleted -= OnVideoPrepared;
+ videoPlayer.prepareCompleted -= OnVideoPreparedForPreload;
+ videoPlayer.prepareCompleted -= OnVideoPreparedForURL;
+ videoPlayer.loopPointReached -= OnVideoFinished;
+
+ videoPlayer.Stop();
+ videoPlayer.clip = null;
+ videoPlayer.url = null;
+ videoPlayer.targetTexture = null;
+
+ if (videoImage != null)
+ {
+ videoImage.texture = null;
+ }
+
+ _loadedClip = null;
+ ReleaseRenderTexture();
+
+ // 鎭㈠绌虹姸鎬�
+ SetEmptyState();
+
+ _isPrepared = false;
+ _isLoading = false;
+ onComplete = null;
+ onPrepared = null;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// 瑙嗛鏄惁宸插噯澶囧ソ
+ /// </summary>
+ public bool IsPrepared => _isPrepared;
+
+ /// <summary>
+ /// 瑙嗛鏄惁姝e湪鎾斁
+ /// </summary>
+ public bool IsPlaying => videoPlayer != null && videoPlayer.isPlaying;
+
+ /// <summary>
+ /// 瑙嗛鏄惁姝e湪鍔犺浇
+ /// </summary>
+ public bool IsLoading => _isLoading;
+
+ /// <summary>
+ /// 褰撳墠鎾斁鏃堕棿锛堢锛�
+ /// </summary>
+ public double CurrentTime => videoPlayer != null ? videoPlayer.time : 0;
+
+ /// <summary>
+ /// 瑙嗛鎬绘椂闀匡紙绉掞級
+ /// </summary>
+ public double Duration => _loadedClip != null ? _loadedClip.length : 0;
+
+ #endregion
+
+ #region Private Methods
+
+ [ContextMenu("閲嶆柊鍔犺浇")]
+ private void Reload()
+ {
+ LoadAndPlayVideo(videoName, isLoop);
+ }
+
+ private void OnVideoPrepared(VideoPlayer vp)
+ {
+ vp.prepareCompleted -= OnVideoPrepared;
+ _isPrepared = true;
+ _isLoading = false;
+ onPrepared?.Invoke();
+ vp.Play();
+ }
+
+ private void OnVideoPreparedForPreload(VideoPlayer vp)
+ {
+ vp.prepareCompleted -= OnVideoPreparedForPreload;
+ _isPrepared = true;
+ _isLoading = false;
+ _onPrepareCallback?.Invoke(true);
+ _onPrepareCallback = null;
+ // 棰勫姞杞藉畬鎴愬悗涓嶈嚜鍔ㄦ挱鏀�
+ }
+
+ private void OnVideoPreparedForURL(VideoPlayer vp)
+ {
+ vp.prepareCompleted -= OnVideoPreparedForURL;
+ _isPrepared = true;
+ _isLoading = false;
+
+ // 璋冩暣 RenderTexture 灏哄涓哄疄闄呰棰戝昂瀵�
+ if (_renderTexture != null && vp.texture != null)
+ {
+ var newRT = new RenderTexture((int)vp.width, (int)vp.height, 0);
+ ReleaseRenderTexture();
+ _renderTexture = newRT;
+ vp.targetTexture = _renderTexture;
+ videoImage.texture = _renderTexture;
+ videoImage.SetNativeSize();
+ }
+
+ onPrepared?.Invoke();
+ vp.Play();
+ }
+
+ private void OnVideoFinished(VideoPlayer vp)
+ {
+ onComplete?.Invoke();
+
+ // 鏍规嵁璁剧疆鑷姩娓呯悊璧勬簮
+ if (autoUnloadOnFinish)
+ {
+ Unload();
+ }
+ }
+
+ private void ReleaseRenderTexture()
+ {
+ if (_renderTexture != null)
+ {
+ _renderTexture.Release();
+ Destroy(_renderTexture);
+ _renderTexture = null;
+ }
+ }
+
+ /// <summary>
+ /// 璁剧疆绌虹姸鎬侊紙鏈姞杞借棰戞椂锛�
+ /// </summary>
+ private void SetEmptyState()
+ {
+ if (videoImage != null)
+ {
+ videoImage.enabled = false;
+ }
+ }
+
+ /// <summary>
+ /// 璁剧疆婵�娲荤姸鎬侊紙瑙嗛宸插姞杞斤級
+ /// </summary>
+ private void SetActiveState()
+ {
+ if (videoImage != null)
+ {
+ videoImage.enabled = true;
+ }
+ }
+
+ /// <summary>
+ /// 楠岃瘉蹇呴渶缁勪欢
+ /// </summary>
+ private bool ValidateComponents()
+ {
+ if (videoPlayer == null)
+ {
+ Debug.LogError("UIVideoPlayer: VideoPlayer component is not assigned.");
+ return false;
+ }
+ if (videoImage == null)
+ {
+ Debug.LogError("UIVideoPlayer: RawImage component is not assigned.");
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region Unity Lifecycle
+
+ private void Awake()
+ {
+ // 鍒濆鍖栨椂璁剧疆涓虹┖鐘舵��
+ SetEmptyState();
+ }
+
+ private void OnDestroy()
+ {
+ Unload();
+ }
+
+ /// <summary>
+ /// 鍙栨秷棰勫姞杞�
+ /// </summary>
+ public void CancelPrepare()
+ {
+ if (videoPlayer == null) return;
+
+ // 鍙栨秷鎵�鏈夊噯澶囩浉鍏崇殑浜嬩欢璁㈤槄
+ videoPlayer.prepareCompleted -= OnVideoPrepared;
+ videoPlayer.prepareCompleted -= OnVideoPreparedForPreload;
+ videoPlayer.prepareCompleted -= OnVideoPreparedForURL;
+
+ // 鍋滄 VideoPlayer锛堝鏋滄鍦ㄥ姞杞斤級
+ if (_isLoading)
+ {
+ videoPlayer.Stop();
+ }
+
+ // 娓呯悊璧勬簮
+ videoPlayer.clip = null;
+ videoPlayer.url = null;
+ videoPlayer.targetTexture = null;
+
+ if (videoImage != null)
+ {
+ videoImage.texture = null;
+ }
+
+ _loadedClip = null;
+ ReleaseRenderTexture();
+ SetEmptyState();
+
+ // 閲嶇疆鐘舵��
+ _isPrepared = false;
+ _isLoading = false;
+
+ // 瑙﹀彂澶辫触鍥炶皟
+ _onPrepareCallback?.Invoke(false);
+ _onPrepareCallback = null;
+ }
+
+ #endregion
+}
diff --git a/Main/System/Video/UIVideoPlayer.cs.meta b/Main/System/Video/UIVideoPlayer.cs.meta
new file mode 100644
index 0000000..a6bce43
--- /dev/null
+++ b/Main/System/Video/UIVideoPlayer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 780579551ee7fe442bc047278c4b96d6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Video/VideoManager.cs b/Main/System/Video/VideoManager.cs
new file mode 100644
index 0000000..18f7ac3
--- /dev/null
+++ b/Main/System/Video/VideoManager.cs
@@ -0,0 +1,117 @@
+
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class VideoManager : Singleton<VideoManager>
+{
+ private GameObjectPoolManager.GameObjectPool uiVideoPool;
+
+ private Dictionary<string, UIVideoPlayer> prepareDict = new Dictionary<string, UIVideoPlayer>();
+
+ private Dictionary<string, Action<bool, UIVideoPlayer>> prepareCallbacks = new Dictionary<string, Action<bool, UIVideoPlayer>>();
+
+ public void Init()
+ {
+ GameObject uiVideoPrefab = UILoader.LoadPrefab("UIVideoPlayer");
+ uiVideoPool = GameObjectPoolManager.Instance.GetPool(uiVideoPrefab);
+ }
+
+ public void Release()
+ {
+ if (uiVideoPool != null)
+ {
+ uiVideoPool.Clear();
+ uiVideoPool = null;
+ }
+ }
+
+ private UIVideoPlayer GetUIVideoPlayer()
+ {
+ GameObject videoObj = uiVideoPool.Request();
+ if (videoObj != null)
+ {
+ return videoObj.GetComponent<UIVideoPlayer>();
+ }
+ return null;
+ }
+
+ public UIVideoPlayer PrepareVideo(string videoName, Action<bool, UIVideoPlayer> onPrepared)
+ {
+ // 濡傛灉宸茬粡鍦ㄥ噯澶囦腑锛岀洿鎺ヨ繑鍥� 骞剁粰鍑烘彁绀� 宸茬粡鍦ㄥ姞杞藉噯澶囦腑
+ if (prepareDict.TryGetValue(videoName, out UIVideoPlayer existingPlayer))
+ {
+ Debug.LogError("Video " + videoName + " is already being prepared.");
+ return existingPlayer;
+ }
+
+
+ UIVideoPlayer uiVideoPlayer = GetUIVideoPlayer();
+ if (uiVideoPlayer != null)
+ {
+ string _videoName = videoName; // 閬垮厤闂寘闂
+ prepareDict.Add(_videoName, uiVideoPlayer);
+ prepareCallbacks.Add(_videoName, onPrepared);
+ uiVideoPlayer.Prepare(videoName, (success) =>
+ {
+ OnPrepareOK(videoName, success, uiVideoPlayer);
+ });
+ }
+ else
+ {
+ Debug.LogError("Failed to get UIVideoPlayer from pool.");
+ onPrepared?.Invoke(false, null);
+ }
+ return uiVideoPlayer;
+ }
+
+
+ public void CancelPrepare(UIVideoPlayer uIVideoPlayer)
+ {
+ if (uIVideoPlayer != null)
+ uIVideoPlayer.CancelPrepare();
+ {
+ uiVideoPool.Release(uIVideoPlayer.gameObject);
+ // 浠� prepareDict 绉婚櫎
+ string keyToRemove = null;
+ foreach (var kv in prepareDict)
+ {
+ if (kv.Value == uIVideoPlayer)
+ {
+ keyToRemove = kv.Key;
+ break;
+ }
+ }
+ if (keyToRemove != null)
+ {
+ prepareDict.Remove(keyToRemove);
+ prepareCallbacks.Remove(keyToRemove);
+ }
+ }
+ }
+
+ private void OnPrepareOK(string videoName, bool success, UIVideoPlayer uiVideoPlayer)
+ {
+ // 瀹夊叏绉婚櫎鍜屽洖璋�
+ if (prepareDict.ContainsKey(videoName))
+ {
+ prepareDict.Remove(videoName);
+ }
+ Action<bool, UIVideoPlayer> callback = null;
+ if (prepareCallbacks.TryGetValue(videoName, out callback))
+ {
+ callback?.Invoke(success, uiVideoPlayer);
+ prepareCallbacks.Remove(videoName);
+ }
+ }
+
+ public void ReleaseVideoPlayer(UIVideoPlayer uIVideoPlayer)
+ {
+ if (uIVideoPlayer != null)
+ {
+ CancelPrepare(uIVideoPlayer);
+ uiVideoPool.Release(uIVideoPlayer.gameObject);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/Video/VideoManager.cs.meta b/Main/System/Video/VideoManager.cs.meta
new file mode 100644
index 0000000..bee492c
--- /dev/null
+++ b/Main/System/Video/VideoManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 14d20be0871f2e24d96b79440816d7cb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Video/VideoWin.cs b/Main/System/Video/VideoWin.cs
new file mode 100644
index 0000000..290345a
--- /dev/null
+++ b/Main/System/Video/VideoWin.cs
@@ -0,0 +1,20 @@
+using System;
+using UnityEngine;
+using UnityEngine.Video;
+using UnityEngine.UI;
+
+public class VideoWin : UIBase
+{
+ public UIVideoPlayer videoPlayer;
+ protected override void OnOpen()
+ {
+ // 瑙嗛鍑嗗瀹屾垚鍚庝細鑷姩鎾斁
+ }
+
+ protected override void OnPreClose()
+ {
+ base.OnPreClose();
+ videoPlayer.Unload();
+ }
+
+}
diff --git a/Main/System/Video/VideoWin.cs.meta b/Main/System/Video/VideoWin.cs.meta
new file mode 100644
index 0000000..3494092
--- /dev/null
+++ b/Main/System/Video/VideoWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cf2a5c5ccb4f22f4c9408bd3b3efed69
+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, //杩愬娍绀煎寘娲诲姩
diff --git a/Main/Utility/Extension.cs b/Main/Utility/Extension.cs
index b5d01c7..9725ea7 100644
--- a/Main/Utility/Extension.cs
+++ b/Main/Utility/Extension.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using Spine;
+using Spine.Unity;
public static class Extension
{
@@ -74,4 +76,61 @@
}
}
}
+
+ public static bool IsSpine(this string _resName)
+ {
+ if (string.IsNullOrEmpty(_resName))
+ {
+ return false;
+ }
+
+ return _resName.Contains("SkeletonData");
+ }
+
+ public static bool IsVideo(this string _resName)
+ {
+ if (string.IsNullOrEmpty(_resName))
+ {
+ return false;
+ }
+
+ return _resName.EndsWith(".mp4");
+ }
+
+ public static bool ContainsMotion(this Spine.Skeleton skeleton, string motionName)
+ {
+ if (skeleton == null || string.IsNullOrEmpty(motionName))
+ {
+ return false;
+ }
+
+ for (int i = 0; i < skeleton.Data.Animations.Count; i++)
+ {
+ if (skeleton.Data.Animations.Items[i].Name.ToLower() == motionName.ToLower())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static Spine.Animation GetSpineAnimation(this Spine.Skeleton skeleton, string motionName)
+ {
+ if (skeleton == null || string.IsNullOrEmpty(motionName))
+ {
+ return null;
+ }
+
+ for (int i = 0; i < skeleton.Data.Animations.Count; i++)
+ {
+ if (skeleton.Data.Animations.Items[i].Name.ToLower() == motionName.ToLower())
+ {
+ return skeleton.Data.Animations.Items[i];
+ }
+ }
+
+ return null;
+ }
+
}
\ No newline at end of file
--
Gitblit v1.8.0