| | |
| | | typeof(ActHeroReturnArtConfig),
|
| | | typeof(ActLunhuidianTypeConfig),
|
| | | typeof(ActSignAwardConfig),
|
| | | typeof(ActTotalRechargeConfig),
|
| | | typeof(ActTotalRechargeTempConfig),
|
| | | typeof(ActTotDayRechargeConfig),
|
| | | typeof(ActTotDayRechargeTempConfig),
|
| | | typeof(ADAwardConfig),
|
| | | typeof(BattleMapConfig),
|
| | | typeof(BeautyConfig),
|
| | |
| | | ClearConfigDictionary<ActLunhuidianTypeConfig>();
|
| | | // 清空 ActSignAwardConfig 字典
|
| | | ClearConfigDictionary<ActSignAwardConfig>();
|
| | | // 清空 ActTotalRechargeConfig 字典
|
| | | ClearConfigDictionary<ActTotalRechargeConfig>();
|
| | | // 清空 ActTotalRechargeTempConfig 字典
|
| | | ClearConfigDictionary<ActTotalRechargeTempConfig>();
|
| | | // 清空 ActTotDayRechargeConfig 字典
|
| | | ClearConfigDictionary<ActTotDayRechargeConfig>();
|
| | | // 清空 ActTotDayRechargeTempConfig 字典
|
| | | ClearConfigDictionary<ActTotDayRechargeTempConfig>();
|
| | | // 清空 ADAwardConfig 字典
|
| | | ClearConfigDictionary<ADAwardConfig>();
|
| | | // 清空 BattleMapConfig 字典
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年4月20日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTotDayRechargeConfig : ConfigBase<int, ActTotDayRechargeConfig> |
| | | { |
| | | static ActTotDayRechargeConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int CfgID; |
| | | public int TemplateID; |
| | | public int ActShopType; |
| | | |
| | | 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 CfgID); |
| | | |
| | | int.TryParse(tables[1],out TemplateID); |
| | | |
| | | int.TryParse(tables[2],out ActShopType); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 76b774172f2c1ec41852272287e4b25c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年4月20日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTotDayRechargeTempConfig : ConfigBase<int, ActTotDayRechargeTempConfig> |
| | | { |
| | | static ActTotDayRechargeTempConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int AwardID; |
| | | public int TemplateID; |
| | | public int NeedDay; |
| | | public int[][] AwardItemList; |
| | | |
| | | 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 AwardID); |
| | | |
| | | int.TryParse(tables[1],out TemplateID); |
| | | |
| | | int.TryParse(tables[2],out NeedDay); |
| | | |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[3].Replace("(", "[").Replace(")", "]")); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b6d7d5571b6413f489eb78b5fe653a5f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年4月20日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTotalRechargeConfig : ConfigBase<int, ActTotalRechargeConfig> |
| | | { |
| | | static ActTotalRechargeConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int CfgID; |
| | | public int IsDayReset; |
| | | public int CTGTempID; |
| | | public int CTGShopType; |
| | | |
| | | 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 CfgID); |
| | | |
| | | int.TryParse(tables[1],out IsDayReset); |
| | | |
| | | int.TryParse(tables[2],out CTGTempID); |
| | | |
| | | int.TryParse(tables[3],out CTGShopType); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a27d596fa4a6e284c90afe1cb0e50d5b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年4月20日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTotalRechargeTempConfig : ConfigBase<int, ActTotalRechargeTempConfig> |
| | | { |
| | | static ActTotalRechargeTempConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int AwardID; |
| | | public int TemplateID; |
| | | public float NeedAmount; |
| | | public int AwardIndex; |
| | | public int[][] AwardItemList; |
| | | |
| | | 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 AwardID); |
| | | |
| | | int.TryParse(tables[1],out TemplateID); |
| | | |
| | | float.TryParse(tables[2],out NeedAmount); |
| | | |
| | | int.TryParse(tables[3],out AwardIndex); |
| | | |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f90ea937d9f96a549a3f2f9c9ce1c59b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public partial class ActTotDayRechargeTempConfig : ConfigBase<int, ActTotDayRechargeTempConfig> |
| | | { |
| | | // 模板编号: 所需累充天 :奖励ID |
| | | private static Dictionary<int, Dictionary<int, int>> infoDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | // 模板编号 所需累充天 |
| | | private static Dictionary<int, List<int>> sortDict = new Dictionary<int, List<int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!infoDict.TryGetValue(TemplateID, out var dict)) |
| | | { |
| | | dict = new Dictionary<int, int>(); |
| | | infoDict[TemplateID] = dict; |
| | | } |
| | | dict[NeedDay] = AwardID; |
| | | } |
| | | |
| | | private static void LoadSortList() |
| | | { |
| | | if (!sortDict.IsNullOrEmpty()) return; |
| | | foreach (var kvp in infoDict) |
| | | { |
| | | int templateID = kvp.Key; |
| | | List<int> list = new List<int>(kvp.Value.Keys); |
| | | list.Sort(); |
| | | sortDict[templateID] = list; |
| | | } |
| | | } |
| | | |
| | | public static List<int> GetNeedDaySortList(int templateID) |
| | | { |
| | | LoadSortList(); |
| | | sortDict.TryGetValue(templateID, out var list); |
| | | return list; |
| | | } |
| | | |
| | | public static Dictionary<int, int> GetTemplateIDDict(int templateID) |
| | | { |
| | | infoDict.TryGetValue(templateID, out var dict); |
| | | return dict; |
| | | } |
| | | |
| | | public static int GetID(int templateID, int needDay) |
| | | { |
| | | var dict = GetTemplateIDDict(templateID); |
| | | if (dict == null) return 0; |
| | | |
| | | dict.TryGetValue(needDay, out var id); |
| | | return id; |
| | | } |
| | | |
| | | public static ActTotDayRechargeTempConfig GetConfig(int templateID, int needDay) |
| | | { |
| | | int id = GetID(templateID, needDay); |
| | | return Get(id); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 200643bb4766ae74fbb865f9583a43e0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public partial class ActTotalRechargeTempConfig : ConfigBase<int, ActTotalRechargeTempConfig> |
| | | { |
| | | // 模板编号: 奖励索引 :奖励ID |
| | | private static Dictionary<int, Dictionary<int, int>> infoDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | // 模板编号 奖励索引 |
| | | private static Dictionary<int, List<int>> sortDict = new Dictionary<int, List<int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!infoDict.TryGetValue(TemplateID, out var dict)) |
| | | { |
| | | dict = new Dictionary<int, int>(); |
| | | infoDict[TemplateID] = dict; |
| | | } |
| | | dict[AwardIndex] = AwardID; |
| | | } |
| | | |
| | | private static void LoadSortList() |
| | | { |
| | | if (!sortDict.IsNullOrEmpty()) return; |
| | | foreach (var kvp in infoDict) |
| | | { |
| | | int templateID = kvp.Key; |
| | | List<int> list = new List<int>(kvp.Value.Keys); |
| | | list.Sort(); |
| | | sortDict[templateID] = list; |
| | | } |
| | | } |
| | | |
| | | public static List<int> GetAwardIndexSortList(int templateID) |
| | | { |
| | | LoadSortList(); |
| | | sortDict.TryGetValue(templateID, out var list); |
| | | return list; |
| | | } |
| | | |
| | | public static Dictionary<int, int> GetTemplateIDDict(int templateID) |
| | | { |
| | | infoDict.TryGetValue(templateID, out var dict); |
| | | return dict; |
| | | } |
| | | |
| | | public static int GetID(int templateID, int awardIndex) |
| | | { |
| | | var dict = GetTemplateIDDict(templateID); |
| | | if (dict == null) return 0; |
| | | |
| | | dict.TryGetValue(awardIndex, out var id); |
| | | return id; |
| | | } |
| | | |
| | | public static ActTotalRechargeTempConfig GetConfig(int templateID, int awardIndex) |
| | | { |
| | | int id = GetID(templateID, awardIndex); |
| | | return Get(id); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c6b8fcbcc60e80f459e9b25121ff4f34 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1A 累充天活动玩家信息 #tagSCActTotDayRechargePlayerInfo |
| | | |
| | | public class DTCAA1A_tagSCActTotDayRechargePlayerInfo : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HAA1A_tagSCActTotDayRechargePlayerInfo vNetData = vNetPack as HAA1A_tagSCActTotDayRechargePlayerInfo; |
| | | TotDayRechargeManager.Instance.UpdateTotDayRechargePlayerInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ff910fd4544f88147a8ac9ebe5d54a6c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1B 累充天活动信息 #tagSCActTotDayRechargeInfo |
| | | |
| | | public class DTCAA1B_tagSCActTotDayRechargeInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA1B_tagSCActTotDayRechargeInfo vNetData = vNetPack as HAA1B_tagSCActTotDayRechargeInfo; |
| | | OperationTimeHepler.Instance.UpdateActTotDayRechargeInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2ab40d2df9df70846b324d89389c5fb7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1C 累充活动玩家信息 #tagSCActTotalRechargePlayerInfo |
| | | |
| | | public class DTCAA1C_tagSCActTotalRechargePlayerInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA1C_tagSCActTotalRechargePlayerInfo vNetData = vNetPack as HAA1C_tagSCActTotalRechargePlayerInfo; |
| | | TotalRechargeManager.Instance.UpdateTotalRechargePlayerInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8bf165379885e0a4685dd17c772c34c2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1D 累充活动信息 #tagSCActTotalRechargeInfo |
| | | |
| | | public class DTCAA1D_tagSCActTotalRechargeInfo : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HAA1D_tagSCActTotalRechargeInfo vNetData = vNetPack as HAA1D_tagSCActTotalRechargeInfo; |
| | | OperationTimeHepler.Instance.UpdateActTotalRechargeInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a9b1c15e1cc65e940a9e3c967001c7cd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(HA925_tagSCQunyingPlayerInfo), typeof(DTCA925_tagSCQunyingPlayerInfo)); |
| | | Register(typeof(HC010_tagSCCrossZoneInfo), typeof(DTCC010_tagSCCrossZoneInfo)); |
| | | Register(typeof(HA305_tagSCHorseIDInfo), typeof(DTCA305_tagSCHorseIDInfo)); |
| | | Register(typeof(HAA1A_tagSCActTotDayRechargePlayerInfo), typeof(DTCAA1A_tagSCActTotDayRechargePlayerInfo)); |
| | | Register(typeof(HAA1B_tagSCActTotDayRechargeInfo), typeof(DTCAA1B_tagSCActTotDayRechargeInfo)); |
| | | Register(typeof(HAA1C_tagSCActTotalRechargePlayerInfo), typeof(DTCAA1C_tagSCActTotalRechargePlayerInfo)); |
| | | Register(typeof(HAA1D_tagSCActTotalRechargeInfo), typeof(DTCAA1D_tagSCActTotalRechargeInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1A 累充天活动玩家信息 #tagSCActTotDayRechargePlayerInfo |
| | | |
| | | public class HAA1A_tagSCActTotDayRechargePlayerInfo : GameNetPackBasic { |
| | | public byte ActNum; //活动编号 |
| | | public byte TotalDays; //活动累充天数 |
| | | public uint AwardRecord; //累充天奖励领奖记录,按天二进制位存储是否已领取 |
| | | |
| | | public HAA1A_tagSCActTotDayRechargePlayerInfo () { |
| | | _cmd = (ushort)0xAA1A; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TotalDays, vBytes, NetDataType.BYTE); |
| | | TransBytes (out AwardRecord, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d69e237c7851de84ab85e666d561e809 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1B 累充天活动信息 #tagSCActTotDayRechargeInfo |
| | | |
| | | public class HAA1B_tagSCActTotDayRechargeInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public ushort CfgID; // 活动时间表配置ID |
| | | |
| | | public HAA1B_tagSCActTotDayRechargeInfo () { |
| | | _cmd = (ushort)0xAA1B; |
| | | } |
| | | |
| | | 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 CfgID, vBytes, NetDataType.WORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 98ba7407ed7fd9e4eac77a6e39e53bce |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1C 累充活动玩家信息 #tagSCActTotalRechargePlayerInfo |
| | | |
| | | public class HAA1C_tagSCActTotalRechargePlayerInfo : GameNetPackBasic { |
| | | public byte ActNum; //活动编号 |
| | | public uint CoinTotal; //活动累计充值额coin值 |
| | | public uint AwardRecord; //累充奖励领奖记录,按奖励索引二进制位存储是否已领取 |
| | | |
| | | public HAA1C_tagSCActTotalRechargePlayerInfo () { |
| | | _cmd = (ushort)0xAA1C; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out CoinTotal, vBytes, NetDataType.DWORD); |
| | | TransBytes (out AwardRecord, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 041f64014b18e6340be4b4c2f63f2a8d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 1D 累充活动信息 #tagSCActTotalRechargeInfo |
| | | |
| | | public class HAA1D_tagSCActTotalRechargeInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public ushort CfgID; // 活动时间表配置ID |
| | | |
| | | public HAA1D_tagSCActTotalRechargeInfo () { |
| | | _cmd = (ushort)0xAA1D; |
| | | } |
| | | |
| | | 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 CfgID, vBytes, NetDataType.WORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8e1a6e96357ef3e4e91707b9a141f552 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | managers.Add(ViewBuffManager.Instance);
|
| | | managers.Add(HeroReturnManager.Instance);
|
| | | managers.Add(CrossServerBaseManager.Instance);
|
| | | managers.Add(TotalRechargeManager.Instance);
|
| | | managers.Add(TotDayRechargeManager.Instance);
|
| | |
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | { |
| | | DisplayHeroReturn(); |
| | | } |
| | | |
| | | else if (type == OperationType.TotalRecharge || type == OperationType.TotDayRecharge) |
| | | { |
| | | DisplayGalaBtn(); |
| | | } |
| | | } |
| | | |
| | | private void OpenServerActivityStateChange() |
| | |
| | | DisplayTimeRush(); |
| | | DisplayHeroDebut(); |
| | | DisplayHeroReturn(); |
| | | DisplayGalaBtn(); |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | |
| | | osHeroTrainBtn.SetActive(OSActivityManager.Instance.IsOpened(7)); |
| | | osBeautyMMBtn.SetActive(OSActivityManager.Instance.IsOpened(8)); |
| | | osMinggeBtn.SetActive(OSActivityManager.Instance.IsOpened(9)); |
| | | osGalaBtn.SetActive(OSActivityManager.Instance.IsOpenedOSGala()); |
| | | DisplayGalaBtn(); |
| | | } |
| | | |
| | | void OnDayEvent() |
| | |
| | | DisplayOSActivity(); |
| | | } |
| | | |
| | | void DisplayGalaBtn() |
| | | { |
| | | bool isGalaOpen = TotDayRechargeManager.Instance.IsOpen || TotalRechargeManager.Instance.IsOpen; |
| | | osGalaBtn.SetActive(OSActivityManager.Instance.IsOpenedOSGala() || isGalaOpen); |
| | | } |
| | | |
| | | void DisplayTimeRush() |
| | | { |
| | |
| | | public void UpdateRedpoint()
|
| | | {
|
| | | osMainLevelRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
|
| | | osGalaRedpoint2.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSGalaChange) ? RedPointState.Simple : RedPointState.None;
|
| | | osGalaRedpoint2.state = IsOpenedOSGala() && !DayRemind.Instance.GetDayRemind(DayRemind.OSGalaChange) ? RedPointState.Simple : RedPointState.None;
|
| | | osHeroTrainRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
|
| | | osBeautyMMRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
|
| | | osMinggeRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
|
| | |
| | | //-------------------------------------------------------- |
| | | |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | |
| | | |
| | | |
| | | ////开服盛典 |
| | | public class OSGalaBaseWin : FunctionsBaseWin |
| | | public class OSGalaBaseWin : UIBase |
| | | { |
| | | [SerializeField] Transform moneyTrans2; |
| | | [SerializeField] Transform galaTrans; |
| | | [SerializeField] ScrollerController tabScroller; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text timeText; |
| | | [SerializeField] Text galaTimeText; |
| | | [SerializeField] Text totalScoreText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Image[] gotImgs; |
| | | [SerializeField] Text[] scoreTexts; |
| | | [SerializeField] UIEffectPlayer[] effectPlayers; |
| | | |
| | | [SerializeField] Transform totalRechargeTrans; |
| | | [SerializeField] Text totalRechargeTimeText; |
| | | [SerializeField] ItemCell totalRechargeItemCell; |
| | | [SerializeField] Text totalRechargeScoreText; |
| | | [SerializeField] RotationTween totalRechargeRotationTween; |
| | | [SerializeField] Image totalRechargeFreeRedImage; |
| | | [SerializeField] Image totalRechargeHaveImage; |
| | | |
| | | [SerializeField] Transform totDayRechargeTrans; |
| | | [SerializeField] Text totDayRechargeTimeText; |
| | | [SerializeField] ItemCell totDayRechargeItemCell; |
| | | [SerializeField] Text totDayRechargeScoreText; |
| | | [SerializeField] RotationTween totDayRechargeRotationTween; |
| | | [SerializeField] Image totDayRechargeFreeRedImage; |
| | | [SerializeField] Image totDayRechargeHaveImage; |
| | | |
| | | private int nowTabId = 0; |
| | | private UIBase currentSubUI; |
| | | private List<int> tabIdList = new List<int> { 0, 1, 2, 3, 4 }; |
| | | private Dictionary<int, string> tabTitleKeys = new Dictionary<int, string> |
| | | { |
| | | { 0, "DayMission1" }, |
| | | { 1, "OSActivity9" }, |
| | | { 2, "OSActivity3" }, |
| | | { 3, "TotalRecharge04" }, |
| | | { 4, "TotalRecharge05" }, |
| | | }; |
| | | private Dictionary<int, int> tabRedpointKeys = new Dictionary<int, int> |
| | | { |
| | | { 0, 1131 }, |
| | | { 1, 1132 }, |
| | | { 2, 1133 }, |
| | | { 3, 1135 }, |
| | | { 4, 1136 }, |
| | | }; |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | tabScroller.OnRefreshCell += OnRefreshTabCell; |
| | | OSActivityManager.Instance.OnOSGalaDataChangeEvent += OnOSGalaDataChangeEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += ShowTime; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | TotalRechargeManager.Instance.OnTotalRechargePlayerInfoEvent += OnTotalRechargePlayerInfoEvent; |
| | | TotDayRechargeManager.Instance.OnTotDayRechargePlayerInfoEvent += OnTotDayRechargePlayerInfoEvent; |
| | | CreateTabScroller(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | tabScroller.OnRefreshCell -= OnRefreshTabCell; |
| | | OSActivityManager.Instance.OnOSGalaDataChangeEvent -= OnOSGalaDataChangeEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= ShowTime; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | TotalRechargeManager.Instance.OnTotalRechargePlayerInfoEvent -= OnTotalRechargePlayerInfoEvent; |
| | | TotDayRechargeManager.Instance.OnTotDayRechargePlayerInfoEvent -= OnTotDayRechargePlayerInfoEvent; |
| | | CloseCurrentSubUI(); |
| | | } |
| | | |
| | | |
| | | protected override void OpenSubUIByTabIndex() |
| | | private void OnTotDayRechargePlayerInfoEvent() |
| | | { |
| | | switch (functionOrder) |
| | | tabScroller.m_Scorller.RefreshActiveCellViews(); |
| | | SelectBottomTab(nowTabId); |
| | | Display(); |
| | | } |
| | | |
| | | private void OnTotalRechargePlayerInfoEvent() |
| | | { |
| | | tabScroller.m_Scorller.RefreshActiveCellViews(); |
| | | SelectBottomTab(nowTabId); |
| | | Display(); |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | tabScroller.m_Scorller.RefreshActiveCellViews(); |
| | | SelectBottomTab(nowTabId); |
| | | Display(); |
| | | } |
| | | |
| | | private void CreateTabScroller() |
| | | { |
| | | tabScroller.Refresh(); |
| | | bool isOSGalaOpen = OSActivityManager.Instance.IsOpenedOSGala(); |
| | | bool isTotDayRechargeOpen = TotDayRechargeManager.Instance.IsOpen; |
| | | bool isTotalRechargeOpen = TotalRechargeManager.Instance.IsOpen; |
| | | List<int> visibleTabs = new List<int>(); |
| | | for (int i = 0; i < tabIdList.Count; i++) |
| | | { |
| | | int tabId = tabIdList[i]; |
| | | bool canShow = false; |
| | | if (tabId == 0 || tabId == 1 || tabId == 2) |
| | | { |
| | | canShow = isOSGalaOpen; |
| | | } |
| | | else if (tabId == 3) |
| | | { |
| | | canShow = isTotalRechargeOpen; |
| | | } |
| | | else if (tabId == 4) |
| | | { |
| | | canShow = isTotDayRechargeOpen; |
| | | } |
| | | if (canShow) |
| | | { |
| | | visibleTabs.Add(tabId); |
| | | tabScroller.AddCell(ScrollerDataType.Header, tabId); |
| | | } |
| | | } |
| | | if (visibleTabs.Count > 0) |
| | | { |
| | | nowTabId = visibleTabs[0]; |
| | | } |
| | | tabScroller.Restart(); |
| | | SelectBottomTab(nowTabId); |
| | | } |
| | | |
| | | private void OnRefreshTabCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<OSGalaTabCell>(); |
| | | string titleKey = tabTitleKeys.ContainsKey(cell.index) ? tabTitleKeys[cell.index] : ""; |
| | | int redpointId = tabRedpointKeys.ContainsKey(cell.index) ? tabRedpointKeys[cell.index] : 0; |
| | | _cell?.Display(cell.index, nowTabId, titleKey, redpointId, OnTabClicked); |
| | | } |
| | | |
| | | private void OnTabClicked(int index) |
| | | { |
| | | if (nowTabId == index) |
| | | { |
| | | return; |
| | | } |
| | | nowTabId = index; |
| | | tabScroller.m_Scorller.RefreshActiveCellViews(); |
| | | SelectBottomTab(index); |
| | | } |
| | | |
| | | private void SelectBottomTab(int index) |
| | | { |
| | | if (currentSubUI != null) |
| | | { |
| | | currentSubUI.CloseWindow(); |
| | | currentSubUI = null; |
| | | } |
| | | |
| | | galaTrans.SetActive(index == 0 || index == 1 || index == 2); |
| | | moneyTrans2.SetActive(index == 0 || index == 1 || index == 2); |
| | | |
| | | totalRechargeTrans.SetActive(index == 3); |
| | | totDayRechargeTrans.SetActive(index == 4); |
| | | |
| | | switch (index) |
| | | { |
| | | case 0: |
| | | currentSubUI = UIManager.Instance.OpenWindow<OSGalaMissionWin>(); |
| | |
| | | case 2: |
| | | currentSubUI = UIManager.Instance.OpenWindow<OSGalaGiftWin>(); |
| | | break; |
| | | case 3: |
| | | currentSubUI = UIManager.Instance.OpenWindow<TotalRechargeWin>(); |
| | | |
| | | var data = TotalRechargeManager.Instance.GetStoreData(); |
| | | bool isReceived = TotalRechargeManager.Instance.IsReceived(data.shopId); |
| | | totalRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt)); |
| | | totalRechargeItemCell.button.SetListener(() => |
| | | { |
| | | if (!isReceived) |
| | | { |
| | | StoreModel.Instance.SendBuyShopItem(data.storeConfig, 1); |
| | | } |
| | | else |
| | | { |
| | | ItemTipUtility.Show(data.storeConfig.ItemID); |
| | | } |
| | | |
| | | }); |
| | | |
| | | totalRechargeHaveImage.SetActive(isReceived); |
| | | totalRechargeFreeRedImage.SetActive(!isReceived); |
| | | totalRechargeTimeText.text = TotalRechargeManager.Instance.GetActTimeStr(); |
| | | totalRechargeScoreText.text = Language.Get("TotalRecharge06", TotalRechargeManager.Instance.coinTotal); |
| | | if (!isReceived) |
| | | { |
| | | totalRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totalRechargeRotationTween.Stop(); |
| | | totalRechargeRotationTween.SetStartState(); |
| | | } |
| | | break; |
| | | case 4: |
| | | currentSubUI = UIManager.Instance.OpenWindow<TotDayRechargeWin>(); |
| | | |
| | | var data1 = TotDayRechargeManager.Instance.GetStoreData(); |
| | | bool isReceived1 = TotDayRechargeManager.Instance.IsReceived(data1.shopId); |
| | | totDayRechargeItemCell.Init(new ItemCellModel(data1.storeConfig.ItemID, false, data1.storeConfig.ItemCnt)); |
| | | totDayRechargeItemCell.button.SetListener(() => |
| | | { |
| | | if (!isReceived1) |
| | | { |
| | | StoreModel.Instance.SendBuyShopItem(data1.storeConfig, 1); |
| | | } |
| | | else |
| | | { |
| | | ItemTipUtility.Show(data1.storeConfig.ItemID); |
| | | } |
| | | |
| | | }); |
| | | |
| | | totDayRechargeHaveImage.SetActive(isReceived1); |
| | | totDayRechargeFreeRedImage.SetActive(!isReceived1); |
| | | totDayRechargeTimeText.text = TotDayRechargeManager.Instance.GetActTimeStr(); |
| | | totDayRechargeScoreText.text = Language.Get("TotalRecharge07", TotDayRechargeManager.Instance.totalDays); |
| | | if (!isReceived1) |
| | | { |
| | | totDayRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totDayRechargeRotationTween.Stop(); |
| | | totDayRechargeRotationTween.SetStartState(); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void CloseCurrentSubUI() |
| | | { |
| | | if (currentSubUI != null) |
| | | { |
| | | currentSubUI.CloseWindow(); |
| | | currentSubUI = null; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | void ShowTime() |
| | | { |
| | | if (TimeUtility.OpenDay >= OSActivityManager.Instance.osGalaOpenDays) |
| | | { |
| | | timeText.text = Language.Get("OSActivity6"); |
| | | galaTimeText.text = Language.Get("OSActivity6"); |
| | | } |
| | | else |
| | | { |
| | | timeText.text = Language.Get("OSActivity10") + TimeUtility.SecondsToShortDHMS(TimeUtility.GetRemindTimeByOpenDay(OSActivityManager.Instance.osGalaOpenDays)); |
| | | galaTimeText.text = Language.Get("OSActivity10") + TimeUtility.SecondsToShortDHMS(TimeUtility.GetRemindTimeByOpenDay(OSActivityManager.Instance.osGalaOpenDays)); |
| | | } |
| | | totalRechargeTimeText.text = TotalRechargeManager.Instance.GetActTimeStr(); |
| | | totDayRechargeTimeText.text = TotDayRechargeManager.Instance.GetActTimeStr(); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class OSGalaTabCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Color unSelectColor; |
| | | [SerializeField] Color selectColor; |
| | | [SerializeField] ImageEx bgImage; |
| | | [SerializeField] TextEx titleText; |
| | | [SerializeField] RedpointBehaviour redpoint; |
| | | [SerializeField] ButtonEx tabButton; |
| | | |
| | | private Action<int> onClick; |
| | | |
| | | public void Display(int index, int selectedIndex, string title, int redpointId, Action<int> onClick) |
| | | { |
| | | this.onClick = onClick; |
| | | bool isSelected = index == selectedIndex; |
| | | |
| | | bgImage.SetSprite(isSelected ? "TimeRushTabSelect" : "TimeRushTabUnSelect"); |
| | | titleText.text = Language.Get(title); |
| | | titleText.color = isSelected ? selectColor : unSelectColor; |
| | | |
| | | redpoint.redpointId = redpointId; |
| | | |
| | | tabButton.SetListener(() => |
| | | { |
| | | onClick?.Invoke(index); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3e7742ee2b0612c43bac55038ea42ed0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | //累充活动 |
| | | public class OperationTotDayRechargeInfo : OperationBase |
| | | { |
| | | public int CfgID; // 活动时间表配置ID |
| | | |
| | | 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(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ed77821f2b2191d49b55143750ec812c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | //累充活动 |
| | | public class OperationTotalRechargeInfo : OperationBase |
| | | { |
| | | public int CfgID; // 活动时间表配置ID |
| | | |
| | | 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(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2ca29732cd569824088e31f2f83bdbfb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | public void UpdateActTotalRechargeInfo(HAA1D_tagSCActTotalRechargeInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(OperationType.TotalRecharge, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(OperationType.TotalRecharge);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationTotalRechargeInfo();
|
| | | operationDict.Add(OperationType.TotalRecharge, operationBase);
|
| | | }
|
| | | OperationTotalRechargeInfo operation = operationBase as OperationTotalRechargeInfo;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.ActNum = package.ActNum;
|
| | | operation.CfgID = package.CfgID;
|
| | | |
| | | var config = ActTotalRechargeConfig.Get(package.CfgID);
|
| | | if (config == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(OperationType.TotalRecharge);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateActTotDayRechargeInfo(HAA1B_tagSCActTotDayRechargeInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(OperationType.TotDayRecharge, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(OperationType.TotDayRecharge);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationTotDayRechargeInfo();
|
| | | operationDict.Add(OperationType.TotDayRecharge, operationBase);
|
| | | }
|
| | | OperationTotDayRechargeInfo operation = operationBase as OperationTotDayRechargeInfo;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.ActNum = package.ActNum;
|
| | | operation.CfgID = package.CfgID;
|
| | |
|
| | | var config = ActTotalRechargeConfig.Get(package.CfgID);
|
| | | if (config == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | | |
| | | operation.dayReset = config.IsDayReset == 1;
|
| | | operationTimeUpdateEvent?.Invoke(OperationType.TotDayRecharge);
|
| | | }
|
| | | }
|
| | |
|
| | | // public void UpdateActYunShiInfo(HAA87_tagMCActYunshiInfo package)
|
| | | // {
|
| | | // Operation operationType = Operation.default48;
|
| | |
| | | TimeRush = 1, //日期型活动 - 轮回殿
|
| | | HeroDebut = 2, //日期型活动 - 武将登场
|
| | | HeroReturn = 3, //日期型活动 - 武将返场
|
| | | TotalRecharge = 4,//累充活动
|
| | | TotDayRecharge = 5, //累充天活动
|
| | | max,
|
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 640279443a4eebc458a4b9a817e0fe2f |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class TotDayRechargeCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImage; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | |
| | | TotDayRechargeManager manager { get { return TotDayRechargeManager.Instance; } } |
| | | |
| | | public void Display(int index, List<int> list) |
| | | { |
| | | if (list.IsNullOrEmpty() || index < 0 || index >= list.Count) |
| | | return; |
| | | int awardID = list[index]; |
| | | var config = ActTotDayRechargeTempConfig.Get(awardID); |
| | | if (config == null) |
| | | return; |
| | | nameText.text = Language.Get($"TotalRecharge03", config.NeedDay); |
| | | |
| | | if (config.AwardItemList != null) |
| | | { |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | var cell = itemCells[i]; |
| | | |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | var item = config.AwardItemList[i]; |
| | | cell.SetActive(true); |
| | | cell.Init(new ItemCellModel(item[0], false, item[1])); |
| | | cell.button.AddListener(() => ItemTipUtility.Show(item[0])); |
| | | } |
| | | else |
| | | { |
| | | cell.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | processText.text = Language.Get("BoneField09", manager.totalDays, config.NeedDay); |
| | | processImage.fillAmount = manager.totalDays / (float)config.NeedDay; |
| | | |
| | | int state = manager.GetState(awardID);// 获取奖励状态 0 不可领取 1 未领取 2 已领取 |
| | | |
| | | gotoBtn.SetActive(state == 0); |
| | | getBtn.SetActive(state == 1); |
| | | gotRect.SetActive(state == 2); |
| | | |
| | | getBtn.SetListener(() => manager.SendGetReward(config.NeedDay)); |
| | | gotoBtn.SetListener(() => |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true)) |
| | | { |
| | | RechargeManager.Instance.selectTabIndex = 1; |
| | | if (UIManager.Instance.IsOpened<StoreBaseWin>()) |
| | | { |
| | | UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(2); |
| | | } |
| | | else |
| | | { |
| | | UIManager.Instance.OpenWindow<StoreBaseWin>(2); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 731ccb7a2bf5d7e49bcd9379cad5ca55 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | public class TotDayRechargeManager : GameSystemManager<TotDayRechargeManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 10; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj != (int)FuncOpenEnum.OSGala) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | totalDays = 0; |
| | | awardRecord = 0; |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.TotDayRechargeAct; |
| | | public static OperationType operaType = OperationType.TotDayRecharge; |
| | | // 总奖励 |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 6); |
| | | public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType); |
| | | public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType); |
| | | public bool priorityOpen => redPoint.state == RedPointState.Simple; |
| | | public readonly int actNum = 10; |
| | | public event Action<int> onStateUpdate; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | |
| | | } |
| | | if (UIManager.Instance.IsOpened<OSGalaBaseWin>()) |
| | | UIManager.Instance.CloseWindow<OSGalaBaseWin>(); |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OperationStartEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | if (UIManager.Instance.IsOpened<OSGalaBaseWin>()) |
| | | UIManager.Instance.CloseWindow<OSGalaBaseWin>(); |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | public void UpdateRedPoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OSGala)) |
| | | return; |
| | | if (!IsOpen) |
| | | return; |
| | | |
| | | var awardList = GetShowList(); |
| | | if (awardList == null) |
| | | return; |
| | | for (int i = 0; i < awardList.Count; i++) |
| | | { |
| | | if (GetState(awardList[i]) == 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var storeData = GetStoreData(); |
| | | if (storeData != null && !IsReceived(storeData.shopId)) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public bool GetActInfo(out OperationTotDayRechargeInfo act, out ActTotDayRechargeConfig config) |
| | | { |
| | | config = null; |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out act) || act == null) |
| | | return false; |
| | | config = ActTotDayRechargeConfig.Get(act.CfgID); |
| | | return config != null; |
| | | } |
| | | |
| | | public List<int> GetShowList(bool isSort = false) |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | return null; |
| | | |
| | | int templateID = config.TemplateID; |
| | | var res = new List<int>(); |
| | | |
| | | var awardIndexSortList = ActTotDayRechargeTempConfig.GetNeedDaySortList(templateID); |
| | | for (int i = 0; i < awardIndexSortList.Count; i++) |
| | | { |
| | | var tempConfig = ActTotDayRechargeTempConfig.GetConfig(templateID, awardIndexSortList[i]); |
| | | if (tempConfig == null) |
| | | continue; |
| | | res.Add(tempConfig.AwardID); |
| | | } |
| | | |
| | | if (isSort) |
| | | { |
| | | res = res.OrderBy(awardId => |
| | | { |
| | | var tempConfig = ActTotDayRechargeTempConfig.Get(awardId); |
| | | return IsAwardHave(tempConfig.NeedDay); |
| | | }) |
| | | .ThenBy(awardId => awardId) |
| | | .ToList(); |
| | | |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public bool IsCanBuyShop(int shopID) |
| | | { |
| | | StoreConfig config = StoreConfig.Get(shopID); |
| | | if (config == null) |
| | | return false; |
| | | StoreModel.Instance.TryGetIsSellOut(config, out int remainNum); |
| | | return remainNum > 0; |
| | | } |
| | | |
| | | public StoreModel.StoreData GetStoreData() |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | return null; |
| | | int actShopType = config.ActShopType; |
| | | if (StoreModel.Instance.storeTypeDict == null) |
| | | return null; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(actShopType, out var list)) |
| | | return null; |
| | | if (list.IsNullOrEmpty()) |
| | | return null; |
| | | return list[0]; |
| | | } |
| | | |
| | | bool IsAwardHave(int awardIndex) |
| | | { |
| | | if (awardIndex < 0 || awardIndex >= 32) |
| | | return false; |
| | | return (awardRecord & (1u << awardIndex)) != 0; |
| | | } |
| | | |
| | | // 获取奖励状态 0 不可领取 1 未领取 2 已领取 |
| | | public int GetState(int awardID) |
| | | { |
| | | var config = ActTotDayRechargeTempConfig.Get(awardID); |
| | | if (config == null) |
| | | return 0; |
| | | if (totalDays < config.NeedDay) |
| | | return 0; |
| | | bool isAwardHave = IsAwardHave(config.NeedDay); |
| | | return isAwardHave ? 2 : 1; |
| | | } |
| | | |
| | | public bool IsReceived(int shopId) |
| | | { |
| | | var config = StoreConfig.Get(shopId); |
| | | if (config == null) |
| | | return false; |
| | | int boughtCount = StoreModel.Instance.GetShopLimitBuyCount(shopId); |
| | | return boughtCount >= config.LimitCnt; |
| | | } |
| | | |
| | | public string GetActTimeStr() |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | { |
| | | return Language.Get("OSActivity6"); |
| | | } |
| | | return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | |
| | | public byte totalDays; //活动累充天数 |
| | | public uint awardRecord; //累充奖励领奖记录,按奖励索引二进制位存储是否已领取 |
| | | public event Action OnTotDayRechargePlayerInfoEvent; |
| | | public void UpdateTotDayRechargePlayerInfo(HAA1A_tagSCActTotDayRechargePlayerInfo vNetData) |
| | | { |
| | | if (ActNum != vNetData.ActNum) |
| | | return; |
| | | totalDays = vNetData.TotalDays; |
| | | awardRecord = vNetData.AwardRecord; |
| | | UpdateRedPoint(); |
| | | OnTotDayRechargePlayerInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | public void SendGetReward(int needDay) |
| | | { |
| | | string actStr = ActNum.ToString(); |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 19; |
| | | pack.DataEx = (uint)needDay; |
| | | pack.DataExStr = actStr; |
| | | pack.DataExStrLen = (byte)actStr.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4231ac3f6f8d84f4189f5e0f55b93ca0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | //开服活动-累充 |
| | | public class TotDayRechargeWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | TotDayRechargeManager manager { get { return TotDayRechargeManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | TotDayRechargeManager.Instance.OnTotDayRechargePlayerInfoEvent += OnTotDayRechargePlayerInfoEvent; |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | TotDayRechargeManager.Instance.OnTotDayRechargePlayerInfoEvent -= OnTotDayRechargePlayerInfoEvent; |
| | | } |
| | | |
| | | private void OnTotDayRechargePlayerInfoEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | List<int> showList; |
| | | void CreateScroller() |
| | | { |
| | | |
| | | showList = manager.GetShowList(true); |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < showList.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | | |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as TotDayRechargeCell; |
| | | _cell.Display(cell.index, showList); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7b483a9d19723db4da256313000559c0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 027d9e03375d65d4197c9f4d1fefa8a5 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class TotalRechargeCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImage; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | |
| | | TotalRechargeManager manager { get { return TotalRechargeManager.Instance; } } |
| | | |
| | | public void Display(int index, List<int> list) |
| | | { |
| | | if (list.IsNullOrEmpty() || index < 0 || index >= list.Count) |
| | | return; |
| | | int awardID = list[index]; |
| | | var config = ActTotalRechargeTempConfig.Get(awardID); |
| | | if (config == null) |
| | | return; |
| | | nameText.text = Language.Get($"TotalRecharge02", config.NeedAmount); |
| | | |
| | | if (config.AwardItemList != null) |
| | | { |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | var cell = itemCells[i]; |
| | | |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | var item = config.AwardItemList[i]; |
| | | cell.SetActive(true); |
| | | cell.Init(new ItemCellModel(item[0], false, item[1])); |
| | | cell.button.AddListener(() => ItemTipUtility.Show(item[0])); |
| | | } |
| | | else |
| | | { |
| | | cell.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | processText.text = Language.Get("BoneField09", manager.coinTotal, config.NeedAmount); |
| | | processImage.fillAmount = manager.coinTotal / (float)config.NeedAmount; |
| | | |
| | | int state = manager.GetState(awardID);// 获取奖励状态 0 不可领取 1 未领取 2 已领取 |
| | | |
| | | gotoBtn.SetActive(state == 0); |
| | | getBtn.SetActive(state == 1); |
| | | gotRect.SetActive(state == 2); |
| | | |
| | | getBtn.SetListener(() => manager.SendGetReward(config.AwardIndex)); |
| | | gotoBtn.SetListener(() => |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true)) |
| | | { |
| | | RechargeManager.Instance.selectTabIndex = 1; |
| | | if (UIManager.Instance.IsOpened<StoreBaseWin>()) |
| | | { |
| | | UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(2); |
| | | } |
| | | else |
| | | { |
| | | UIManager.Instance.OpenWindow<StoreBaseWin>(2); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 133e398df7d3dcb408b3a7dcfb33f083 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | public class TotalRechargeManager : GameSystemManager<TotalRechargeManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 10; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj != (int)FuncOpenEnum.OSGala) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | coinTotal = 0; |
| | | awardRecord = 0; |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.TotalRechargeAct; |
| | | public static OperationType operaType = OperationType.TotalRecharge; |
| | | // 总奖励 |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 5); |
| | | public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType); |
| | | public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType); |
| | | public bool priorityOpen => redPoint.state == RedPointState.Simple; |
| | | public readonly int actNum = 10; |
| | | public event Action<int> onStateUpdate; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | |
| | | } |
| | | if (UIManager.Instance.IsOpened<OSGalaBaseWin>()) |
| | | UIManager.Instance.CloseWindow<OSGalaBaseWin>(); |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OperationStartEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | if (UIManager.Instance.IsOpened<OSGalaBaseWin>()) |
| | | UIManager.Instance.CloseWindow<OSGalaBaseWin>(); |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | public void UpdateRedPoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OSGala)) |
| | | return; |
| | | if (!IsOpen) |
| | | return; |
| | | |
| | | var awardList = GetShowList(); |
| | | if (awardList == null) |
| | | return; |
| | | for (int i = 0; i < awardList.Count; i++) |
| | | { |
| | | if (GetState(awardList[i]) == 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var storeData = GetStoreData(); |
| | | if (storeData != null && !IsReceived(storeData.shopId)) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | public bool GetActInfo(out OperationTotalRechargeInfo act, out ActTotalRechargeConfig config) |
| | | { |
| | | config = null; |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out act) || act == null) |
| | | return false; |
| | | config = ActTotalRechargeConfig.Get(act.CfgID); |
| | | return config != null; |
| | | } |
| | | |
| | | public List<int> GetShowList(bool isSort = false) |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | return null; |
| | | |
| | | int ctgTempID = config.CTGTempID; |
| | | int ctgShopType = config.CTGShopType; |
| | | var res = new List<int>(); |
| | | |
| | | var awardIndexSortList = ActTotalRechargeTempConfig.GetAwardIndexSortList(ctgTempID); |
| | | for (int i = 0; i < awardIndexSortList.Count; i++) |
| | | { |
| | | var tempConfig = ActTotalRechargeTempConfig.GetConfig(ctgTempID, awardIndexSortList[i]); |
| | | if (tempConfig == null) |
| | | continue; |
| | | res.Add(tempConfig.AwardID); |
| | | } |
| | | |
| | | if (isSort) |
| | | { |
| | | res = res.OrderBy(awardId => |
| | | { |
| | | var tempConfig = ActTotalRechargeTempConfig.Get(awardId); |
| | | return IsAwardHave(tempConfig.AwardIndex); |
| | | }) |
| | | .ThenBy(awardId => awardId) |
| | | .ToList(); |
| | | |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public bool IsCanBuyShop(int shopID) |
| | | { |
| | | StoreConfig config = StoreConfig.Get(shopID); |
| | | if (config == null) |
| | | return false; |
| | | StoreModel.Instance.TryGetIsSellOut(config, out int remainNum); |
| | | return remainNum > 0; |
| | | } |
| | | |
| | | public StoreModel.StoreData GetStoreData() |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | return null; |
| | | int ctgShopType = config.CTGShopType; |
| | | if (StoreModel.Instance.storeTypeDict == null) |
| | | return null; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(ctgShopType, out var list)) |
| | | return null; |
| | | if (list.IsNullOrEmpty()) |
| | | return null; |
| | | return list[0]; |
| | | } |
| | | |
| | | public float coinTotal; //活动累计充值额coin值 |
| | | public uint awardRecord; //累充奖励领奖记录,按奖励索引二进制位存储是否已领取 |
| | | public event Action OnTotalRechargePlayerInfoEvent; |
| | | public void UpdateTotalRechargePlayerInfo(HAA1C_tagSCActTotalRechargePlayerInfo vNetData) |
| | | { |
| | | if (ActNum != vNetData.ActNum) |
| | | return; |
| | | coinTotal = (float)vNetData.CoinTotal / (float)100; |
| | | awardRecord = vNetData.AwardRecord; |
| | | UpdateRedPoint(); |
| | | OnTotalRechargePlayerInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | bool IsAwardHave(int awardIndex) |
| | | { |
| | | if (awardIndex < 0 || awardIndex >= 32) |
| | | return false; |
| | | return (awardRecord & (1u << awardIndex)) != 0; |
| | | } |
| | | |
| | | // 获取奖励状态 0 不可领取 1 未领取 2 已领取 |
| | | public int GetState(int awardID) |
| | | { |
| | | var config = ActTotalRechargeTempConfig.Get(awardID); |
| | | if (config == null) |
| | | return 0; |
| | | if (coinTotal < config.NeedAmount) |
| | | return 0; |
| | | bool isAwardHave = IsAwardHave(config.AwardIndex); |
| | | return isAwardHave ? 2 : 1; |
| | | } |
| | | |
| | | public bool IsReceived(int shopId) |
| | | { |
| | | var config = StoreConfig.Get(shopId); |
| | | if (config == null) |
| | | return false; |
| | | int boughtCount = StoreModel.Instance.GetShopLimitBuyCount(shopId); |
| | | return boughtCount >= config.LimitCnt; |
| | | } |
| | | |
| | | public string GetActTimeStr() |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | { |
| | | return Language.Get("OSActivity6"); |
| | | } |
| | | return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | |
| | | public void SendGetReward(int awardIndex) |
| | | { |
| | | string actStr = ActNum.ToString(); |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 18; |
| | | pack.DataEx = (uint)awardIndex; |
| | | pack.DataExStr = actStr; |
| | | pack.DataExStrLen = (byte)actStr.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2aa04ba840c15be45a5d2236db47addb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | //开服活动-累充 |
| | | public class TotalRechargeWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | TotalRechargeManager manager { get { return TotalRechargeManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | TotalRechargeManager.Instance.OnTotalRechargePlayerInfoEvent += OnTotalRechargePlayerInfoEvent; |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | TotalRechargeManager.Instance.OnTotalRechargePlayerInfoEvent -= OnTotalRechargePlayerInfoEvent; |
| | | } |
| | | |
| | | private void OnTotalRechargePlayerInfoEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | List<int> showList; |
| | | void CreateScroller() |
| | | { |
| | | |
| | | showList = manager.GetShowList(true); |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < showList.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | | |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as TotalRechargeCell; |
| | | _cell.Display(cell.index, showList); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c6c1822a2a0e67a428b6826bc212fd68 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | TimeRushAct = 200, //轮回殿(武将冲刺) |
| | | HeroDebutAct = 201, //英雄登场活动 |
| | | HeroReturnAct = 202, //英雄返场活动 |
| | | TotalRechargeAct = 4, //累充活动 |
| | | TotDayRechargeAct = 5, //累充天活动 |
| | | } |
| | | |
| | | //仙玉购买的二次确认框类型 |