Main/Config/ConfigManager.cs
@@ -38,6 +38,7 @@ // 加载配置文件 HashSet<Type> configTypes = new HashSet<Type>() { typeof(ActLunhuidianTypeConfig), typeof(ADAwardConfig), typeof(BattleMapConfig), typeof(BeautyConfig), @@ -258,6 +259,8 @@ public override void Release() { // 清空 ActLunhuidianTypeConfig 字典 ClearConfigDictionary<ActLunhuidianTypeConfig>(); // 清空 ADAwardConfig 字典 ClearConfigDictionary<ADAwardConfig>(); // 清空 BattleMapConfig 字典 Main/Config/Configs/ActLunhuidianTypeConfig.cs
New file @@ -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); } } } Main/Config/Configs/ActLunhuidianTypeConfig.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 68536606680071843968c757d340ca39 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs
New file @@ -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); } } Main/Config/PartialConfigs/ActLunhuidianTypeConfig.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 2d2ecb0a241fb274ca3795554f869a1b MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs
New file @@ -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); } } Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA88_tagMCActLunhuidianInfo.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 449e1ce1e1ee26940a650a40f4b02770 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs
New file @@ -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); } } Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA89_tagMCActLunhuidianPlayerInfo.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: af4c2ff45746d0242b3debab8472b7e9 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: 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)); } //主工程注册封包 Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs
New file @@ -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; // 奖励物品列表 } } Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA88_tagMCActLunhuidianInfo.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 43c3e23f4ddcc8c4f9a2e6ffd631b763 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs
New file @@ -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); } } Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA89_tagMCActLunhuidianPlayerInfo.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 4b06e47c41ad471429c77f4c82a23f08 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/Main.cs
@@ -106,6 +106,7 @@ managers.Add(GMNotifyManager.Instance); managers.Add(TimingGiftManager.Instance); managers.Add(SettingDataManager.Instance); managers.Add(TimeRushManager.Instance); foreach (var manager in managers) { Main/System/Main/HomeWin.cs
@@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; using Cysharp.Threading.Tasks; using DG.Tweening; using UnityEngine; @@ -67,6 +68,7 @@ [SerializeField] Button osHeroCallBtn; [SerializeField] Button osGalaBtn; [SerializeField] TimingGiftCell timingGiftCell; [SerializeField] TimeRushCell timeRushCell; //坐骑 [SerializeField] Image horseBGImg; @@ -269,13 +271,14 @@ ChatManager.Instance.OnUpdateTalkEvent += OnUpdateTalkEvent; UIManager.Instance.OnOpenWindow += OnOpenWindow; TimingGiftManager.Instance.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent; OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange; TryPlayAutoFightBoss(); Display(); DisplayFirstChargeBtn(); DisplayOSActivity(); timingGiftCell.InitUI(); // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); DisplayTimeRush(); DelayPlayMusic().Forget(); @@ -305,8 +308,14 @@ ChatManager.Instance.OnUpdateTalkEvent -= OnUpdateTalkEvent; UIManager.Instance.OnOpenWindow -= OnOpenWindow; TimingGiftManager.Instance.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent; OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange; // 关闭的时候把战斗界面也给关了 虽然是在外面开的 UIManager.Instance.CloseWindow<BattleWin>(); } private void OpenServerActivityStateChange() { DisplayTimeRush(); } private void OnShowGiftIdListAddEvent() @@ -793,6 +802,10 @@ { timingGiftCell.InitUI(); } else if (funcId == (int)FuncOpenEnum.TimeRush) { DisplayTimeRush(); } } private void OnUpdateFirstChargeInfo() @@ -847,6 +860,16 @@ { DisplayOSActivity(); } void DisplayTimeRush() { bool isOpen = TimeRushManager.Instance.IsFuncOpen(); timeRushCell.SetActive(isOpen); if (!isOpen) return; timeRushCell.InitUI(); } } 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,//限时特惠 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() { Main/System/TimeRush.meta
New file @@ -0,0 +1,8 @@ fileFormatVersion: 2 guid: 7332dc3700298964f9961b3ca4da2c98 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/OperationCycleHall.cs
New file @@ -0,0 +1,84 @@ using 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]; } } } Main/System/TimeRush/OperationCycleHall.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 0808e48a7e494424ab338530cfbc9c41 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushCell.cs
New file @@ -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); } }); } } Main/System/TimeRush/TimeRushCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: cc10e231ecf97b9489602d412f470819 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushGiftCell.cs
New file @@ -0,0 +1,136 @@ using System.Collections.Generic; using UnityEngine; public class TimeRushGiftCell : MonoBehaviour { [SerializeField] TextEx titleText; [SerializeField] ItemCell[] itemCells; [SerializeField] ButtonEx buyButton; [SerializeField] ImageEx buyImage; [SerializeField] TextEx buyText; [SerializeField] TextEx buyText1; [SerializeField] ImageEx moneyIconImage; [SerializeField] TextEx limitCountText; [SerializeField] ImageEx redImage; TimeRushManager manager { get { return TimeRushManager.Instance; } } StoreModel storeModel { get { return StoreModel.Instance; } } public void Display(int index, List<TimeRushGiftItem> giftItems) { if (giftItems.IsNullOrEmpty() || index < 0 || index >= giftItems.Count) return; TimeRushGiftItem item = giftItems[index]; if (item.type == 0) { DisplayStore(item.id); return; } DisplayCTG(item.id); } private void DisplayCTG(int ctgId) { redImage.SetActive(false); buyText.SetActive(true); buyText1.SetActive(false); moneyIconImage.SetActive(false); if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderConfig)) return; if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out var rechargeCount)) return; if (!CTGConfig.HasKey(ctgId)) return; if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out var rechargeItemList)) return; CTGConfig config = CTGConfig.Get(ctgId); bool isCanBuy = manager.IsCanBuyCTG(ctgId); titleText.text = config.Title; buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum)); limitCountText.SetActive(true); limitCountText.text = Language.Get("TimeRush07", UIHelper.AppendColor(rechargeCount.totalCount >= config.TotalBuyCount ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, config.TotalBuyCount - rechargeCount.totalCount).ToString())); buyButton.interactable = isCanBuy; buyButton.SetListener(() => { RechargeManager.Instance.CTG(ctgId); }); for (int i = 0; i < itemCells.Length; i++) { var itemBaisc = itemCells[i]; if (i < rechargeItemList.Count) { var itemInfo = rechargeItemList[i]; itemBaisc.SetActive(true); itemBaisc.Init(new ItemCellModel((int)itemInfo.id, false, itemInfo.countEx)); itemBaisc.button.AddListener(() => { ItemTipUtility.Show((int)itemInfo.id); }); } else { itemBaisc.SetActive(false); } } } private void DisplayStore(int id) { if (!StoreConfig.HasKey(id)) return; StoreConfig storeConfig = StoreConfig.Get(id); int remainNum; storeModel.TryGetIsSellOut(storeConfig, out remainNum); bool isFree = manager.IsFree(id); titleText.text = storeConfig.Name; limitCountText.SetActive(!isFree); limitCountText.text = Language.Get("TimeRush08", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.Green, Mathf.Max(0, remainNum).ToString(), true)); bool isCanBuy = manager.IsCanBuyShop(id); redImage.SetActive(isFree && isCanBuy); buyText.SetActive(isFree || !isCanBuy); buyText.text = isFree ? Language.Get("L1127") : Language.Get("storename11"); buyText1.SetActive(!isFree && isCanBuy); buyText1.text = UIHelper.GetMoneyFormat(storeConfig.MoneyNum); moneyIconImage.SetActive(!isFree && isCanBuy); moneyIconImage.SetIconWithMoneyType(1); buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); buyButton.interactable = isCanBuy; buyButton.SetListener(() => { storeModel.SendBuyShopItemWithPopCheck(storeConfig, 1, (int)BuyStoreItemCheckType.ActGift); }); var items = storeModel.GetShopItemlistByIndex(storeConfig); for (int i = 0; i < itemCells.Length; i++) { var itemBaisc = itemCells[i]; if (i < items.Count) { var itemInfo = items[i]; itemBaisc.SetActive(true); itemBaisc.Init(new ItemCellModel(itemInfo.itemId, false, itemInfo.count)); itemBaisc.button.AddListener(() => { ItemTipUtility.Show(itemInfo.itemId); }); } else { itemBaisc.SetActive(false); } } } } public class TimeRushGiftItem { public int type;//0 商店id 1 充值id public int id; } Main/System/TimeRush/TimeRushGiftCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 8e9f60e895d200241adac4eec9b944d7 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushManager.cs
New file @@ -0,0 +1,520 @@ using System; using System.Collections.Generic; using System.Linq; using UnityEngine; public class TimeRushManager : GameSystemManager<TimeRushManager>, IOpenServerActivity { public Action PlayAnimationSync; private bool isPlayAnimation = false; public bool IsPlayAnimation { get { return isPlayAnimation; } set { isPlayAnimation = value; if (isPlayAnimation) { PlayAnimationSync?.Invoke(); } isPlayAnimation = false; } } public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_Activity2; public const int activityID = (int)NewDayActivityID.TimeRushAct; public int actNum = 10; public static OperationType operaType = OperationType.default47; public Redpoint redPoint = new Redpoint(MainRedDot.TimeRushRepoint); public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType); public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType); public bool priorityOpen => redPoint.state == RedPointState.Simple; public event Action<int> onStateUpdate; //类型对应功能ID public Dictionary<int, int> funcIdDict = new Dictionary<int, int>(); public bool TryGetFuncIdByRoundType(int roundType, out int funcId) { return funcIdDict.TryGetValue(roundType, out funcId); } //类型对应窗口ID public Dictionary<int, int> windowIDDict = new Dictionary<int, int>(); public bool TryGetWindowIDByRoundType(int roundType, out int windowID) { return windowIDDict.TryGetValue(roundType, out windowID); } public Dictionary<int, int> moneyTypeDict = new Dictionary<int, int>(); public bool TryGetMoneyTypeByRoundType(int roundType, out int windowID) { return moneyTypeDict.TryGetValue(roundType, out windowID); } public override void Init() { OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent; //storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent; OpenServerActivityCenter.Instance.Register(activityID, this, activityType); var config = FuncConfigConfig.Get("TimeRush"); windowIDDict = ConfigParse.ParseIntDict(config.Numerical1); funcIdDict = ConfigParse.ParseIntDict(config.Numerical2); moneyTypeDict = ConfigParse.ParseIntDict(config.Numerical3); } public override void Release() { OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent; } private void OperationTimeUpdateEvent(OperationType type) { if (type == operaType) { UpdateRedpoint(); } } private void RefreshBuyShopLimitEvent() { UpdateRedpoint(); } private void OperationStartEvent(OperationType type, int state) { if (type == operaType && state == 0) { if (onStateUpdate != null) { onStateUpdate(activityID); } UpdateRedpoint(); } } private void OperationEndEvent(OperationType type, int state) { if (type == operaType) { if (onStateUpdate != null) { onStateUpdate(activityID); } if (UIManager.Instance.IsOpened<TimeRushWin>()) { UIManager.Instance.CloseWindow<TimeRushWin>(); } UpdateRedpoint(); } } private void OperationAdvanceEvent(OperationType type) { if (type == operaType) { if (onStateUpdate != null) { onStateUpdate(activityID); } UpdateRedpoint(); } } public bool TryGetOperationInfo(out OperationCycleHall act) { act = null; return OperationTimeHepler.Instance.TryGetOperation(operaType, out act) && act != null; } public bool TryGetInListIndexById(int id, out int index) { index = -1; var list = GetTabIDList(); if (list.IsNullOrEmpty() || !list.Contains(id)) return false; index = list.IndexOf(id); return index >= 0; } public bool IsFuncOpen() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.TimeRush)) return false; if (!IsOpen) return false; if (!TryGetOperationInfo(out OperationCycleHall act)) return false; List<int> list = GetTabIDList(); if (list.IsNullOrEmpty()) return false; return true; } private int m_NowTabId; public event Action OnNowTabIdChangeEvent; public int nowTabId { get { return m_NowTabId; } set { if (m_NowTabId != value) m_NowTabId = value; OnNowTabIdChangeEvent?.Invoke(); } } public List<int> GetTabIDList() { if (!TryGetOperationInfo(out OperationCycleHall act)) return null; var list = ActLunhuidianTypeConfig.GetTabList(); if (list.IsNullOrEmpty()) return null; List<int> resList = new List<int>(); for (int i = 0; i < list.Count; i++) { int id = list[i]; if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config)) continue; if (!act.TryGetRound(config.RoundType, out var info)) continue; //没配功能ID直接加入 if (!funcIdDict.TryGetValue(config.RoundType, out var funcId)) { if (!resList.Contains(id)) resList.Add(id); continue; } //配了功能ID,判断功能是否开启 if (FuncOpen.Instance.IsFuncOpen(funcId)) { if (!resList.Contains(id)) resList.Add(id); } } return resList; } public Dictionary<int, HAA89_tagMCActLunhuidianPlayerInfo> playerInfoDict = new Dictionary<int, HAA89_tagMCActLunhuidianPlayerInfo>(); public bool TryGetPlayerInfo(int roundType, out HAA89_tagMCActLunhuidianPlayerInfo playerInfo) { return playerInfoDict.TryGetValue(roundType, out playerInfo) && playerInfo != null; } public event Action OnUpdatePlayerInfoEvent; public void UpdatePlayerInfo(HAA89_tagMCActLunhuidianPlayerInfo netPack) { if (actNum != netPack.ActNum) return; if (!playerInfoDict.ContainsKey(netPack.RoundType)) playerInfoDict[netPack.RoundType] = new HAA89_tagMCActLunhuidianPlayerInfo(); playerInfoDict[netPack.RoundType].RoundType = netPack.RoundType; playerInfoDict[netPack.RoundType].CurRound = netPack.CurRound; playerInfoDict[netPack.RoundType].CurValue = netPack.CurValue; playerInfoDict[netPack.RoundType].AwardRecord = netPack.AwardRecord; CheckNewAwardHave(netPack.RoundType, (int)netPack.CurRound, (int)netPack.CurValue); OnUpdatePlayerInfoEvent?.Invoke(); UpdateRedpoint(); } public int newRoundType; public int newAwardType; public int newAwardTypeValue; public int newAwardIndex; // <轮回类型, 上一次的CurRound> public Dictionary<int, int> lastCurRoundDict = new Dictionary<int, int>(); // <轮回类型, 上一次的CurValue> public Dictionary<int, int> lastCurValueDict = new Dictionary<int, int>(); public void CheckNewAwardHave(int roundType, int curRound, int curValue) { if (lastCurRoundDict.ContainsKey(roundType) && lastCurValueDict.ContainsKey(roundType)) { int lastCurRound = lastCurRoundDict[roundType]; int lastCurValue = lastCurValueDict[roundType]; if (lastCurRound < curRound) { lastCurValueDict[roundType] = 0; } lastCurValue = lastCurValueDict[roundType]; if (lastCurValue < curValue) { if (!TryGetOperationInfo(out var act)) return; if (act.TryGetRound(roundType, out var round) && round.AwardList != null) { for (int i = 0; i < round.AwardList.Length; i++) { var Award = round.AwardList[i]; int state = GetAwardState(roundType, Award.AwardIndex); if (Award.NeedValue > lastCurValue && Award.NeedValue <= curValue && state == 1) { newRoundType = roundType; newAwardType = round.AwardType; newAwardTypeValue = (int)round.AwardTypeValue; newAwardIndex = Award.AwardIndex; // if (!DTC0403_tagPlayerLoginLoadOK.neverLoginOk && !WindowCenter.Instance.IsOpen<CycleHallAchievementTipWin>()) // { // WindowCenter.Instance.Open<CycleHallAchievementTipWin>(); // } // UpdateNewAwardHave?.Invoke(); } } } } } lastCurRoundDict[roundType] = curRound; lastCurValueDict[roundType] = curValue; } public int GetAwardState(int roundType, int awardIndex) { if (!TryGetPlayerInfo(roundType, out var playerInfo)) return 0; if (!TryGetOperationInfo(out var act)) return 0; if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex)) return 0; if (playerInfo.CurValue >= awardInfo.NeedValue) { return (playerInfo.AwardRecord & (1 << awardIndex)) != 0 ? 2 : 1; } else { return 0; } } public void HaveAllMissionAward(int roundType) { if (!TryGetOperationInfo(out var act)) return; if (!act.TryGetRound(roundType, out var round) || round.AwardList == null) return; for (int i = 0; i < round.AwardList.Length; i++) { var award = round.AwardList[i]; int state = GetAwardState(roundType, award.AwardIndex); if (state == 1) { SendGetAward(roundType, (int)award.NeedValue); } } } public bool IsCanBuyCTG(int ctgID) { if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount)) return false; if (!CTGConfig.HasKey(ctgID)) return false; CTGConfig config = CTGConfig.Get(ctgID); return rechargeCount.totalCount < config.TotalBuyCount; } public bool IsFree(int shopID) { if (!StoreConfig.HasKey(shopID)) return false; StoreConfig config = StoreConfig.Get(shopID); return config.MoneyNum == 0; } public bool IsCanBuyShop(int shopID) { if (!StoreConfig.HasKey(shopID)) return false; StoreConfig config = StoreConfig.Get(shopID); int remainNum; StoreModel.Instance.TryGetIsSellOut(config, out remainNum); return remainNum > 0; } public List<TimeRushGiftItem> GetGiftItemList(int roundType, bool isSort = false) { List<TimeRushGiftItem> res = new List<TimeRushGiftItem>(); if (TryGetOperationInfo(out var act) && act.TryGetRound(roundType, out var round) && round.CTGIDList != null) { var list = StoreModel.Instance.storeTypeDict[round.ShopType]; if (!list.IsNullOrEmpty()) { for (int i = 0; i < list.Count; i++) { var item = list[i]; if (item.storeConfig == null) continue; res.Add(new TimeRushGiftItem { type = 0, id = item.storeConfig.ID, }); } } for (int i = 0; i < round.CTGIDList.Length; i++) { var item = round.CTGIDList[i]; res.Add(new TimeRushGiftItem { type = 1, id = item, }); } if (isSort) { res = res.OrderBy(item => { bool isCanBuy = item.type == 0 ? IsCanBuyShop(item.id) : IsCanBuyCTG(item.id); return !isCanBuy; }) .ThenBy(item => item.type) .ThenBy(item => item.id) .ToList(); } } return res; } public List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> GetTaskList(int roundType, bool isSort = false) { if (!TryGetOperationInfo(out var act) || !act.TryGetRound(roundType, out var round) || round.AwardList == null) return null; List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> res = round.AwardList.ToList(); if (isSort) { // 先获取状态并缓存,避免排序时重复调用 GetAwardState res = res.Select(award => new { Data = award, State = GetAwardState(roundType, award.AwardIndex) }).OrderBy(x => { // 定义优先级映射:数字越小,排得越靠前 if (x.State == 1) return 0; // 最前:可领取 if (x.State == 0) return 1; // 中间:未达成 return 2; // 最后:已领取 (state == 2) }) .ThenBy(x => x.Data.AwardIndex) // 状态相同时,AwardIndex 小的在前 .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; } } } } } Main/System/TimeRush/TimeRushManager.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 84c9a9bfadc4e62499711a6785fd2ad0 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushTabCell.cs
New file @@ -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; }); } } Main/System/TimeRush/TimeRushTabCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 65202a9b70b44c747913e0d851db8707 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushTaskCell.cs
New file @@ -0,0 +1,137 @@ using System.Collections.Generic; using UnityEngine; public class TimeRushTaskCell : MonoBehaviour { [SerializeField] ButtonEx clickButton; [SerializeField] TextEx titleText; [SerializeField] ImageEx sliderImage; [SerializeField] ImageEx maskImage; [SerializeField] TextEx sliderText; [SerializeField] TimeRushTaskItem[] items; [SerializeField] ItemCell[] itemCells; [SerializeField] ImageEx[] grays; [SerializeField] RotationTween[] tweens; [SerializeField] UIEffectPlayer uiEffectPlayer; int awardIndex; int roundType; int tabType; TimeRushManager manager { get { return TimeRushManager.Instance; } } private void OnEnable() { manager.PlayAnimationSync += OnPlaySyncAnimation; for (int i = 0; i < tweens.Length; i++) { tweens[i].Stop(); tweens[i].SetStartState(); } if (!manager.TryGetOperationInfo(out var act)) return; if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null) return; int state = manager.GetAwardState(roundType, awardIndex); for (int i = 0; i < tweens.Length; i++) { if (i < awardInfo.AwardItemList.Length) { if (state == 1) { tweens[i].Play(); } } } } private void OnDisable() { manager.PlayAnimationSync -= OnPlaySyncAnimation; } private void OnPlaySyncAnimation() { if (tabType != 1) return; for (int i = 0; i < tweens.Length; i++) { tweens[i].Stop(); tweens[i].SetStartState(); } if (!manager.TryGetOperationInfo(out var act)) return; if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null) return; int state = manager.GetAwardState(roundType, awardIndex); for (int i = 0; i < tweens.Length; i++) { if (tweens[i].isActiveAndEnabled && state == 1) { tweens[i].Play(); } } } public void Display(int index, CellView cell, List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> taskList) { roundType = cell.info.Value.infoInt1; tabType = cell.info.Value.infoInt2; if (taskList.IsNullOrEmpty() || index < 0 || index >= taskList.Count) return; var task = taskList[index]; awardIndex = task.AwardIndex; if (!manager.TryGetOperationInfo(out var act)) return; if (!act.TryGetRound(roundType, out var round)) return; if (!manager.TryGetPlayerInfo(roundType, out var playerInfo)) return; int state = manager.GetAwardState(roundType, awardIndex); maskImage.SetActive(state == 2); uiEffectPlayer.SetActive(state == 1); titleText.text = Language.Get($"TimeRushTaskTitle_{round.AwardType}_{round.AwardTypeValue}", task.NeedValue); sliderImage.fillAmount = playerInfo.CurValue / (float)task.NeedValue; sliderText.text = Language.Get("BoneField09", playerInfo.CurValue, task.NeedValue); for (int i = 0; i < itemCells.Length; i++) { var itemBaisc = itemCells[i]; if (i < task.AwardItemList.Length) { var itemInfo = task.AwardItemList[i]; itemBaisc.SetActive(true); grays[i].SetActive(state == 2); ItemCellModel cellModel = new ItemCellModel((int)itemInfo.ItemID, false, itemInfo.ItemCount); itemBaisc.Init(cellModel); itemBaisc.button.AddListener(() => { if (state == 1) { manager.HaveAllMissionAward(roundType); } else { ItemTipUtility.Show((int)itemInfo.ItemID); } }); } else { itemBaisc.SetActive(false); grays[i].SetActive(false); } } clickButton.SetListener(() => { if (state == 1) { manager.HaveAllMissionAward(roundType); } }); } } Main/System/TimeRush/TimeRushTaskCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 9f2398658c04b264eba2671ce96dc050 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushTaskItem.cs
New file @@ -0,0 +1,42 @@ using UnityEngine; public class TimeRushTaskItem : MonoBehaviour { [SerializeField] ItemCell itemCell; [SerializeField] ImageEx gray; [SerializeField] RotationTween tween; TimeRushManager manager { get { return TimeRushManager.Instance; } } public void Display(int state, int roundType, int itemId, int count) { gray.SetActive(state == 2); ItemCellModel cellModel = new ItemCellModel(itemId, false, count); itemCell.Init(cellModel); itemCell.button.AddListener(() => { if (state == 1) { manager.HaveAllMissionAward(roundType); } else { ItemTipUtility.Show(itemId); } }); } public void Play() { if (!gameObject.activeSelf) return; tween.Play(); } public void Stop() { tween.Stop(); tween.SetStartState(); } } Main/System/TimeRush/TimeRushTaskItem.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 46c5176f8abbd614aa070785103e53a7 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/TimeRush/TimeRushWin.cs
New file @@ -0,0 +1,294 @@ using System.Collections.Generic; using Cysharp.Threading.Tasks; using UnityEngine; public class TimeRushWin : UIBase { [SerializeField] ScrollerController tabScroller; [SerializeField] ScrollerController taskScroller; [SerializeField] ScrollerController giftScroller; [SerializeField] ImageEx bgImage; [SerializeField] ImageEx infoBgImage; [SerializeField] ImageEx infoImage; [SerializeField] ImageEx titleBgImage; [SerializeField] GradientText titleText; [SerializeField] ImageEx giftBgImage; [SerializeField] ImageEx giftIconImage; [SerializeField] TextEx timeText; [SerializeField] TextEx roundText; [SerializeField] ButtonEx goButton; [SerializeField] TextEx goText; [SerializeField] OwnMoneyCell ownMoneyCell; [SerializeField] ButtonEx closeButton; TimeRushManager manager { get { return TimeRushManager.Instance; } } StoreModel storeModel { get { return StoreModel.Instance; } } int tabId; protected override void InitComponent() { closeButton.SetListener(CloseWindow); } protected override void OnPreOpen() { tabId = functionOrder; manager.OnNowTabIdChangeEvent += OnNowTabIdChangeEvent; tabScroller.OnRefreshCell += OnRefreshTabCell; taskScroller.OnRefreshCell += OnRefreshTaskCell; giftScroller.OnRefreshCell += OnRefreshGiftCell; GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent; manager.OnUpdatePlayerInfoEvent += OnUpdatePlayerInfoEvent; var list = manager.GetTabIDList(); if (list.IsNullOrEmpty()) { DelayCloseWindow().Forget(); return; } manager.nowTabId = list.Contains(tabId) ? tabId : list[0]; } protected override void OnPreClose() { manager.OnNowTabIdChangeEvent -= OnNowTabIdChangeEvent; tabScroller.OnRefreshCell -= OnRefreshTabCell; taskScroller.OnRefreshCell -= OnRefreshTaskCell; giftScroller.OnRefreshCell -= OnRefreshGiftCell; GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent; OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent; manager.OnUpdatePlayerInfoEvent -= OnUpdatePlayerInfoEvent; } private void OnUpdatePlayerInfoEvent() { RefreshAll(); } private void RefreshBuyShopLimitEvent() { RefreshAll(); } private void OperationTimeUpdateEvent(OperationType operation) { if (operation == OperationType.default47) { RefreshAll(); } } private void OnRechargeCountEvent(int obj) { RefreshAll(); } private void OnSecondEvent() { GetActTime(); } private void OnRefreshTabCell(ScrollerDataType type, CellView cell) { var _cell = cell.GetComponent<TimeRushTabCell>(); _cell?.Display(cell.index); } private void OnRefreshTaskCell(ScrollerDataType type, CellView cell) { var _cell = cell.GetComponent<TimeRushTaskCell>(); _cell?.Display(cell.index, cell, taskList); } private void OnRefreshGiftCell(ScrollerDataType type, CellView cell) { var _cell = cell.GetComponent<TimeRushGiftCell>(); _cell?.Display(cell.index, giftItems); manager.PlayAnimationSync?.Invoke(); } private void OnNowTabIdChangeEvent() { CreateAll(); } void RefreshAll() { int id = manager.nowTabId; if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config)) return; int roundType = config.RoundType; int tabType = config.TabType; tabScroller.m_Scorller.RefreshActiveCellViews(); taskScroller.SetActive(tabType == 1); giftScroller.SetActive(tabType == 2); if (tabType == 1) { CreateTaskScroller(roundType, tabType); return; } if (tabType == 2) { CreateGiftScroller(roundType); return; } Display(id); } void CreateAll() { int id = manager.nowTabId; if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config)) return; if (!manager.TryGetOperationInfo(out var act)) return; int roundType = config.RoundType; int tabType = config.TabType; if (!act.TryGetRound(roundType, out var round)) return; Display(id); CreateTabScroller(); taskScroller.SetActive(tabType == 1); giftScroller.SetActive(tabType == 2); if (tabType == 1) { CreateTaskScroller(roundType, tabType); return; } if (tabType == 2) { CreateGiftScroller(roundType); return; } } private void Display(int id) { if (!ActLunhuidianTypeConfig.TryGetConfig(id, out var config)) return; if (!manager.TryGetOperationInfo(out var act)) return; int roundType = config.RoundType; int tabType = config.TabType; if (!act.TryGetRound(roundType, out var round)) return; if (!manager.TryGetPlayerInfo(roundType, out var playerInfo)) return; GetActTime(); bgImage.SetSprite(config.bgImage); infoBgImage.SetSprite(config.InfoBgImage); infoImage.SetSprite(config.InfoImage); infoImage.SetNativeSize(); titleBgImage.SetSprite(config.TitleBgImage); titleBgImage.SetNativeSize(); titleText.text = Language.Get($"TimeRushTitle{roundType}"); roundText.SetActive(tabType == 1); roundText.text = tabType == 1 ? Language.Get("TimeRush06", playerInfo.CurRound, round.RoundMax) : string.Empty; ownMoneyCell.SetActive(tabType == 2); ownMoneyCell.moneyType = manager.TryGetMoneyTypeByRoundType(roundType, out int monetyType) ? monetyType : 99; ownMoneyCell.Display(true); giftBgImage.SetActive(tabType == 2); giftIconImage.SetActive(tabType == 2); giftIconImage.SetSprite($"TimeRushGiftIcon{roundType}"); DisplayGoButton(config); } void DisplayGoButton(ActLunhuidianTypeConfig config) { int roundType = config.RoundType; int tabType = config.TabType; bool hasWindowID = manager.TryGetWindowIDByRoundType(roundType, out int windowID); goButton.SetActive(tabType == 1 && hasWindowID); if (tabType == 1 && hasWindowID) { goText.text = Language.Get($"TimeRushGoTitle{roundType}"); goButton.SetListener(() => { if (manager.TryGetFuncIdByRoundType(roundType, out int funcId) && !FuncOpen.Instance.IsFuncOpen(funcId, true)) return; UIJumpManager.Instance.OpenWindow(windowID); }); } } private void GetActTime() { if (!manager.TryGetOperationInfo(out var act)) { timeText.text = Language.Get("OSActivity6"); return; } timeText.text = Language.Get("TimeRush05", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); } private void CreateTabScroller() { tabScroller.Refresh(); var list = manager.GetTabIDList(); if (!list.IsNullOrEmpty()) { for (int i = 0; i < list.Count; i++) { tabScroller.AddCell(ScrollerDataType.Header, list[i]); } } tabScroller.Restart(); } List<HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward> taskList; private void CreateTaskScroller(int roundType, int tabType) { taskList = manager.GetTaskList(roundType, true); taskScroller.Refresh(); if (!taskList.IsNullOrEmpty()) { for (int i = 0; i < taskList.Count; i++) { CellInfo cellInfo = new CellInfo(); cellInfo.infoInt1 = roundType; cellInfo.infoInt2 = tabType; taskScroller.AddCell(ScrollerDataType.Header, i, cellInfo); } } taskScroller.Restart(); } List<TimeRushGiftItem> giftItems; private void CreateGiftScroller(int roundType) { giftItems = manager.GetGiftItemList(roundType, true); giftScroller.Refresh(); if (!giftItems.IsNullOrEmpty()) { for (int i = 0; i < giftItems.Count; i++) { giftScroller.AddCell(ScrollerDataType.Header, i); } } giftScroller.Restart(); } } Main/System/TimeRush/TimeRushWin.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 37423ca15fdd33e45b288c668a3698a5 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: 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, //运势礼包活动