628 节假日活动-五一活动 基本功能
1.预览界面没实现,入口已隐藏
2.签到只适配7天的样式
| | |
| | | typeof(ActHeroReturnArtConfig),
|
| | | typeof(ActLunhuidianTypeConfig),
|
| | | typeof(ActSignAwardConfig),
|
| | | typeof(ActSignConfig),
|
| | | typeof(ActSpecialSaleConfig),
|
| | | typeof(ActTaskConfig),
|
| | | typeof(ActTaskTempConfig),
|
| | | typeof(ActTotalRechargeConfig),
|
| | | typeof(ActTotalRechargeTempConfig),
|
| | | typeof(ActTotDayRechargeConfig),
|
| | |
| | | ClearConfigDictionary<ActLunhuidianTypeConfig>();
|
| | | // 清空 ActSignAwardConfig 字典
|
| | | ClearConfigDictionary<ActSignAwardConfig>();
|
| | | // 清空 ActSignConfig 字典
|
| | | ClearConfigDictionary<ActSignConfig>();
|
| | | // 清空 ActSpecialSaleConfig 字典
|
| | | ClearConfigDictionary<ActSpecialSaleConfig>();
|
| | | // 清空 ActTaskConfig 字典
|
| | | ClearConfigDictionary<ActTaskConfig>();
|
| | | // 清空 ActTaskTempConfig 字典
|
| | | ClearConfigDictionary<ActTaskTempConfig>();
|
| | | // 清空 ActTotalRechargeConfig 字典
|
| | | ClearConfigDictionary<ActTotalRechargeConfig>();
|
| | | // 清空 ActTotalRechargeTempConfig 字典
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Tuesday, April 28, 2026 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActSignConfig : ConfigBase<int, ActSignConfig> |
| | | { |
| | | static ActSignConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int CfgID; |
| | | public int SignTempID; |
| | | |
| | | 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 SignTempID); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 28335628185079b4cae244317f179653 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Tuesday, April 28, 2026 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActSpecialSaleConfig : ConfigBase<int, ActSpecialSaleConfig> |
| | | { |
| | | static ActSpecialSaleConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int CfgID; |
| | | public int[] CTGIDList; |
| | | public int ActShopType; |
| | | public int ADID; |
| | | public int ShopType; |
| | | public int ShopItemID; |
| | | public int[][] PopItems; |
| | | |
| | | 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); |
| | | |
| | | if (tables[1].Contains("[")) |
| | | { |
| | | CTGIDList = JsonMapper.ToObject<int[]>(tables[1]); |
| | | } |
| | | else |
| | | { |
| | | string[] CTGIDListStringArray = tables[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | CTGIDList = new int[CTGIDListStringArray.Length]; |
| | | for (int i=0;i<CTGIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(CTGIDListStringArray[i],out CTGIDList[i]); |
| | | } |
| | | } |
| | | |
| | | int.TryParse(tables[2],out ActShopType); |
| | | |
| | | int.TryParse(tables[3],out ADID); |
| | | |
| | | int.TryParse(tables[4],out ShopType); |
| | | |
| | | int.TryParse(tables[5],out ShopItemID); |
| | | |
| | | PopItems = JsonMapper.ToObject<int[][]>(tables[6].Replace("(", "[").Replace(")", "]")); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fee90584a2c90bf429ad939a6a80973a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Tuesday, April 28, 2026 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTaskConfig : ConfigBase<int, ActTaskConfig> |
| | | { |
| | | static ActTaskConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int CfgID; |
| | | public int IsDayReset; |
| | | public int TemplateID; |
| | | public int ActScoreItemID; |
| | | public string ActScoreAwardInfo; |
| | | |
| | | 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 TemplateID); |
| | | |
| | | int.TryParse(tables[3],out ActScoreItemID); |
| | | |
| | | ActScoreAwardInfo = tables[4]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 18ccb33588d91924e929f132457591f2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年4月28日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ActTaskTempConfig : ConfigBase<int, ActTaskTempConfig> |
| | | { |
| | | static ActTaskTempConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int ID; |
| | | public int TemplateID; |
| | | public int TasklD; |
| | | public int TaskType; |
| | | public int NeedValue; |
| | | public int[][] AwardItemList; |
| | | public int GuideID; |
| | | |
| | | 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 TemplateID); |
| | | |
| | | int.TryParse(tables[2],out TasklD); |
| | | |
| | | int.TryParse(tables[3],out TaskType); |
| | | |
| | | int.TryParse(tables[4],out NeedValue); |
| | | |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | int.TryParse(tables[6],out GuideID); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ec9a5f1c58db6994b8f558fc17c191d9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public partial class ActTaskTempConfig : ConfigBase<int, ActTaskTempConfig> |
| | | { |
| | | public static Dictionary<int, List<ActTaskTempConfig>> templateIDToConfigsDict = new Dictionary<int, List<ActTaskTempConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!templateIDToConfigsDict.ContainsKey(TemplateID)) |
| | | { |
| | | templateIDToConfigsDict[TemplateID] = new List<ActTaskTempConfig>(); |
| | | } |
| | | templateIDToConfigsDict[TemplateID].Add(this); |
| | | } |
| | | |
| | | public static List<ActTaskTempConfig> GetTemplateIDToConfigsDict(int templateID) |
| | | { |
| | | if (templateIDToConfigsDict.ContainsKey(templateID)) |
| | | { |
| | | return templateIDToConfigsDict[templateID]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // 累计积分奖励配置 |
| | | public class TotalScoreAwardConfig |
| | | { |
| | | public int needScore; // 所需积分 |
| | | public int recordIndex; // 记录索引 |
| | | public int itemId; // 奖励物品ID |
| | | public int itemCount; // 奖励物品数量 |
| | | } |
| | | |
| | | // 通过CfgID获取累计积分奖励列表 |
| | | public static List<TotalScoreAwardConfig> GetTotalScoreAwardListByCfgID(int cfgId) |
| | | { |
| | | var result = new List<TotalScoreAwardConfig>(); |
| | | var config = ActTaskConfig.Get(cfgId); |
| | | if (config == null || string.IsNullOrEmpty(config.ActScoreAwardInfo) || config.ActScoreAwardInfo == "{}") |
| | | { |
| | | return result; |
| | | } |
| | | |
| | | |
| | | var dict = ConfigParse.ParseIntArrayDict(config.ActScoreAwardInfo); |
| | | foreach (var kvp in dict) |
| | | { |
| | | var arr = kvp.Value; |
| | | if (arr != null && arr.Length >= 3) |
| | | { |
| | | result.Add(new TotalScoreAwardConfig |
| | | { |
| | | needScore = kvp.Key, |
| | | recordIndex = arr[0], |
| | | itemId = arr[1], |
| | | itemCount = arr[2] |
| | | }); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0f7b949b0b810ea4b83d18d7d1113caf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 10 特卖活动信息 #tagSCActSpecialSaleInfo |
| | | |
| | | public class DTCAA10_tagSCActSpecialSaleInfo : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HAA10_tagSCActSpecialSaleInfo vNetData = vNetPack as HAA10_tagSCActSpecialSaleInfo; |
| | | OperationTimeHepler.Instance.UpdateFlashSaleActivityInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 93050a26bbe6ce449a5021d8cdebc682 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | base.Done(vNetPack); |
| | | HAA1A_tagSCActTotDayRechargePlayerInfo vNetData = vNetPack as HAA1A_tagSCActTotDayRechargePlayerInfo; |
| | | TotDayRechargeManager.Instance.UpdateTotDayRechargePlayerInfo(vNetData); |
| | | FestivalActivityRechargeTotDayManager.Instance.UpdateTotDayRechargePlayerInfo(vNetData); |
| | | } |
| | | } |
| | |
| | | base.Done(vNetPack); |
| | | HAA1C_tagSCActTotalRechargePlayerInfo vNetData = vNetPack as HAA1C_tagSCActTotalRechargePlayerInfo; |
| | | TotalRechargeManager.Instance.UpdateTotalRechargePlayerInfo(vNetData); |
| | | FestivalActivityRechargeTotalManager.Instance.UpdateTotalRechargePlayerInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 23 签到活动信息 #tagSCActSignInfo |
| | | |
| | | public class DTCAA23_tagSCActSignInfo : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HAA23_tagSCActSignInfo vNetData = vNetPack as HAA23_tagSCActSignInfo; |
| | | OperationTimeHepler.Instance.UpdateCheckInActivityInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7b92c42956c922f4689fb3d005ccd63c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 71 任务活动信息 #tagSCActTaskInfo |
| | | |
| | | public class DTCAA71_tagSCActTaskInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA71_tagSCActTaskInfo vNetData = vNetPack as HAA71_tagSCActTaskInfo; |
| | | OperationTimeHepler.Instance.UpdateMissionActivityInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e5bfd63d84d04a64295b1e67df4182ba |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 72 任务活动玩家任务值 #tagSCActTaskPlayerValueInfo |
| | | |
| | | public class DTCAA72_tagSCActTaskPlayerValueInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA72_tagSCActTaskPlayerValueInfo vNetData = vNetPack as HAA72_tagSCActTaskPlayerValueInfo; |
| | | FestivalActivityMissionManager.Instance.UpdatePlayerValueInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ff88da8b58bd357419087982180462a2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 73 任务活动玩家信息 #tagSCActTaskPlayerInfo |
| | | |
| | | public class DTCAA73_tagSCActTaskPlayerInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA73_tagSCActTaskPlayerInfo vNetData = vNetPack as HAA73_tagSCActTaskPlayerInfo; |
| | | FestivalActivityMissionManager.Instance.UpdatePlayerInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2622ac73ea207bc41b42b0bea6da8886 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(HAA1B_tagSCActTotDayRechargeInfo), typeof(DTCAA1B_tagSCActTotDayRechargeInfo)); |
| | | Register(typeof(HAA1C_tagSCActTotalRechargePlayerInfo), typeof(DTCAA1C_tagSCActTotalRechargePlayerInfo)); |
| | | Register(typeof(HAA1D_tagSCActTotalRechargeInfo), typeof(DTCAA1D_tagSCActTotalRechargeInfo)); |
| | | Register(typeof(HAA10_tagSCActSpecialSaleInfo), typeof(DTCAA10_tagSCActSpecialSaleInfo)); |
| | | Register(typeof(HAA23_tagSCActSignInfo), typeof(DTCAA23_tagSCActSignInfo)); |
| | | Register(typeof(HAA71_tagSCActTaskInfo), typeof(DTCAA71_tagSCActTaskInfo)); |
| | | Register(typeof(HAA72_tagSCActTaskPlayerValueInfo), typeof(DTCAA72_tagSCActTaskPlayerValueInfo)); |
| | | Register(typeof(HAA73_tagSCActTaskPlayerInfo), typeof(DTCAA73_tagSCActTaskPlayerInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 10 特卖活动信息 #tagSCActSpecialSaleInfo |
| | | |
| | | public class HAA10_tagSCActSpecialSaleInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public ushort CfgID; // 活动时间表配置ID |
| | | |
| | | public HAA10_tagSCActSpecialSaleInfo () { |
| | | _cmd = (ushort)0xAA10; |
| | | } |
| | | |
| | | 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: 0cedf55511caa534a998927e86ba2ac5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 23 签到活动信息 #tagSCActSignInfo |
| | | |
| | | public class HAA23_tagSCActSignInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public ushort CfgID; // 活动时间表配置ID |
| | | |
| | | public HAA23_tagSCActSignInfo () { |
| | | _cmd = (ushort)0xAA23; |
| | | } |
| | | |
| | | 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: e62482e93459c95489f5f137a1367382 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 71 任务活动信息 #tagSCActTaskInfo |
| | | |
| | | public class HAA71_tagSCActTaskInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public ushort CfgID; // 活动时间表配置ID |
| | | |
| | | public HAA71_tagSCActTaskInfo () { |
| | | _cmd = (ushort)0xAA71; |
| | | } |
| | | |
| | | 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: 43a1369401f48644886a0ed6ead11c9a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 72 任务活动玩家任务值 #tagSCActTaskPlayerValueInfo |
| | | |
| | | public class HAA72_tagSCActTaskPlayerValueInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public byte TaskCount; |
| | | public tagSCActTaskPlayerValue[] TaskValueList; // 有同步的任务类型直接覆盖即可 |
| | | |
| | | public HAA72_tagSCActTaskPlayerValueInfo () { |
| | | _cmd = (ushort)0xAA72; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TaskCount, vBytes, NetDataType.BYTE); |
| | | TaskValueList = new tagSCActTaskPlayerValue[TaskCount]; |
| | | for (int i = 0; i < TaskCount; i ++) { |
| | | TaskValueList[i] = new tagSCActTaskPlayerValue(); |
| | | TransBytes (out TaskValueList[i].TaskType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TaskValueList[i].TaskValue, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | | public class tagSCActTaskPlayerValue { |
| | | public byte TaskType; // 任务类型 |
| | | public uint TaskValue; // 当前任务值,所有相同任务类型共享该进度值 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e3ae0803689cf9c41a5e5fdf2674875a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 73 任务活动玩家信息 #tagSCActTaskPlayerInfo |
| | | |
| | | public class HAA73_tagSCActTaskPlayerInfo : GameNetPackBasic { |
| | | public byte ActNum; // 活动编号 |
| | | public uint ActScoreTotal; // 累计活动积分,用于验证领取累计积分奖励用,商店兑换直接用物品兑换物品 |
| | | public uint ActScoreAward; // 累计活动积分领奖记录,按奖励索引位运算判断是否已领取 |
| | | public byte AwardCount; |
| | | public uint[] AwardRecordList; // 任务ID领奖记录值列表,根据任务ID位判断是否已领取,一个记录值存31位 [记录值0, 记录值1, ...] |
| | | |
| | | public HAA73_tagSCActTaskPlayerInfo () { |
| | | _cmd = (ushort)0xAA73; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ActScoreTotal, vBytes, NetDataType.DWORD); |
| | | TransBytes (out ActScoreAward, vBytes, NetDataType.DWORD); |
| | | TransBytes (out AwardCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out AwardRecordList, vBytes, NetDataType.DWORD, AwardCount); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 822917aa36513164eaa88bab3498a208 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | managers.Add(CrossServerBaseManager.Instance);
|
| | | managers.Add(TotalRechargeManager.Instance);
|
| | | managers.Add(TotDayRechargeManager.Instance);
|
| | |
|
| | | managers.Add(FestivalActivityManager.Instance);
|
| | | managers.Add(FestivalActivityRechargeTotalManager.Instance);
|
| | | managers.Add(FestivalActivityRechargeTotDayManager.Instance);
|
| | | managers.Add(FestivalActivityCheckInManager.Instance);
|
| | | managers.Add(FestivalActivityMissionManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | case 6: |
| | | SendGetReward(ADID); |
| | | break; |
| | | case 7: |
| | | SendGetReward(ADID); |
| | | break; |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5533b52633741964d91069149670dd58 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityCheckInCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ButtonEx clickButton; |
| | | [SerializeField] ImageEx bgImage; |
| | | [SerializeField] TextEx dayText; |
| | | [SerializeField] TextEx itemNameText; |
| | | [SerializeField] ItemCell itemCell; |
| | | [SerializeField] UIEffectPlayer uiEffectPlayer; |
| | | [SerializeField] Transform imgMask; |
| | | |
| | | FestivalActivityCheckInManager manager => FestivalActivityCheckInManager.Instance; |
| | | |
| | | private int currentItemId; |
| | | private int currentState; |
| | | |
| | | public void Display(int templateID, int dayNum) |
| | | { |
| | | uiEffectPlayer.Stop(); |
| | | |
| | | var config = ActSignAwardConfig.GetConfig(templateID, dayNum); |
| | | if (config == null) return; |
| | | if (config.SignAwardItemList.IsNullOrEmpty()) return; |
| | | |
| | | currentItemId = config.SignAwardItemList[0][0]; |
| | | int count = config.SignAwardItemList[0][1]; |
| | | |
| | | var itemConfig = ItemConfig.Get(currentItemId); |
| | | if (itemConfig == null) return; |
| | | |
| | | currentState = manager.GetCheckInState(dayNum); |
| | | imgMask.SetActive(currentState == 2); |
| | | bgImage.SetSprite(currentState == 1 ? "HeroDebutCheckInDayBG1" : "HeroDebutCheckInDayBG2"); |
| | | if (currentState == 1) |
| | | { |
| | | uiEffectPlayer.Play(); |
| | | } |
| | | |
| | | dayText.text = Language.Get($"SignDay{dayNum}"); |
| | | itemNameText.text = itemConfig.ItemName; |
| | | |
| | | itemCell.Init(new ItemCellModel(currentItemId, false, count)); |
| | | itemCell.button.AddListener(OnItemClicked); |
| | | |
| | | clickButton.SetListener(() => manager.SendGetCheckInReward()); |
| | | } |
| | | |
| | | private void OnItemClicked() |
| | | { |
| | | if (currentState == 1) |
| | | { |
| | | manager.SendGetCheckInReward(); |
| | | } |
| | | else |
| | | { |
| | | ItemTipUtility.Show(currentItemId); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 466abe185fe4c1e4bbd404360dfe9e42 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | |
| | | public class FestivalActivityCheckInManager : GameSystemManager<FestivalActivityCheckInManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 30; |
| | | |
| | | 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; |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | } |
| | | |
| | | 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; |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | } |
| | | |
| | | private void OnDayEvent() |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnUpdateActSignInfosEvent(int arg1, int arg2) |
| | | { |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj != (int)FuncOpenEnum.FestivalActivity) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.FestivalActivityCheckInAct; |
| | | public static OperationType operaType = OperationType.FestivalActivity_CheckIn; |
| | | |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint, |
| | | FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.CheckIn)); |
| | | |
| | | 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; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | 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) |
| | | { |
| | | 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.FestivalActivity)) |
| | | return; |
| | | if (!IsOpen) |
| | | return; |
| | | |
| | | if (HasCheckInCanHave()) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public OperationCheckInActivityInfo GetOperationCheckInInfo() |
| | | { |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationCheckInActivityInfo act); |
| | | return act; |
| | | } |
| | | |
| | | public bool GetActInfo(out OperationCheckInActivityInfo act, out ActSignConfig config) |
| | | { |
| | | config = null; |
| | | act = GetOperationCheckInInfo(); |
| | | if (act == null) |
| | | return false; |
| | | config = ActSignConfig.Get(act.CfgID); |
| | | return config != null; |
| | | } |
| | | |
| | | private int GetNowDayNum() |
| | | { |
| | | var act = GetOperationCheckInInfo(); |
| | | if (act == null) return 0; |
| | | |
| | | int dayNum = act.IndexOfDays(TimeUtility.ServerNow); |
| | | return dayNum < 0 ? 0 : dayNum + 1; |
| | | } |
| | | |
| | | private bool IsCheckInGridUnlock(int gridDayNum) |
| | | { |
| | | int nowDayNum = GetNowDayNum(); |
| | | if (nowDayNum <= 0) return false; |
| | | |
| | | return nowDayNum >= gridDayNum; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 0-未解锁 1-可签 2-已签 |
| | | /// </summary> |
| | | public int GetCheckInState(int gridDayNum) |
| | | { |
| | | // 签到活动的ActType默认为0 |
| | | if (GeneralActInfoManager.Instance.IsDaySigned(0, ActNum, gridDayNum)) return 2; |
| | | if (IsCheckInGridUnlock(gridDayNum)) return 1; |
| | | return 0; |
| | | } |
| | | |
| | | public void SendGetCheckInReward() |
| | | { |
| | | // 签到活动的ActType默认为0 |
| | | GeneralActInfoManager.Instance.SendGetSignReward(0, ActNum); |
| | | } |
| | | |
| | | public bool HasCheckInCanHave() |
| | | { |
| | | if (!GetActInfo(out var act, out var config)) |
| | | return false; |
| | | |
| | | int templateID = config.SignTempID; |
| | | var list = ActSignAwardConfig.GetDayNumSortList(templateID); |
| | | if (list == null) return false; |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | int dayNum = list[i]; |
| | | int state = GetCheckInState(dayNum); |
| | | if (state == 1) return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public void GetActTimeStr(TextEx timeText, string key = "TimeRush05") |
| | | { |
| | | var act = GetOperationCheckInInfo(); |
| | | if (act == null) |
| | | { |
| | | timeText.text = Language.Get("OSActivity6"); |
| | | return; |
| | | } |
| | | timeText.text = Language.Get(key, TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 36e836fe2fdb08041955a6e15c6346ef |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityCheckInWin : UIBase |
| | | { |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] TextEx timeText; |
| | | [SerializeField] FestivalActivityCheckInCell[] cells; |
| | | FestivalActivityCheckInManager manager => FestivalActivityCheckInManager.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | Display(); |
| | | } |
| | | protected override void OnPreClose() |
| | | { |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | } |
| | | private void OnDayEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | private void OnUpdateActSignInfosEvent(int arg1, int arg2) |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | manager.GetActTimeStr(timeText); |
| | | } |
| | | private void Display() |
| | | { |
| | | if (!manager.GetActInfo(out var act, out var config)) |
| | | return; |
| | | |
| | | int templateID = config.SignTempID; |
| | | var list = ActSignAwardConfig.GetDayNumSortList(templateID); |
| | | if (list == null) return; |
| | | |
| | | for (int i = 0; i < cells.Length; i++) |
| | | { |
| | | if (i < list.Count) |
| | | { |
| | | cells[i].SetActive(true); |
| | | cells[i].Display(templateID, list[i]); |
| | | } |
| | | else |
| | | { |
| | | cells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | OnSecondEvent(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a837dc5f21722df49bca4419569b24bb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityGiftCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ImageEx vipImage; |
| | | [SerializeField] TextEx vipText; |
| | | [SerializeField] OutlineEx vipTextOutline; |
| | | [SerializeField] ImageEx rateImage; |
| | | [SerializeField] TextEx rateText; |
| | | |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] TextEx titleText; |
| | | [SerializeField] ButtonEx buyButton; |
| | | [SerializeField] ImageEx buyImage; |
| | | |
| | | [SerializeField] TextEx buyText; |
| | | [SerializeField] TextEx buyText1; |
| | | [SerializeField] ImageEx moneyIconImage; |
| | | [SerializeField] ImageEx adImage; |
| | | [SerializeField] TextEx limitCountText; |
| | | [SerializeField] ImageEx redImage; |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | StoreModel storeModel => StoreModel.Instance; |
| | | |
| | | public void Display(int index, List<FestivalActivityGiftItem> giftItems) |
| | | { |
| | | if (giftItems.IsNullOrEmpty() || index < 0 || index >= giftItems.Count) return; |
| | | |
| | | FestivalActivityGiftItem item = giftItems[index]; |
| | | if (item.type == 0) |
| | | { |
| | | DisplayStore(item.id); |
| | | return; |
| | | } |
| | | |
| | | if (item.type == 1) |
| | | { |
| | | DisplayAD(item.id); |
| | | return; |
| | | } |
| | | |
| | | |
| | | DisplayCTG(item.id); |
| | | } |
| | | |
| | | private void DisplayCTG(int ctgId) |
| | | { |
| | | redImage.SetActive(false); |
| | | buyText.SetActive(true); |
| | | buyText1.SetActive(false); |
| | | moneyIconImage.SetActive(false); |
| | | adImage.SetActive(false); |
| | | rateImage.SetActive(true); |
| | | |
| | | 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); |
| | | vipImage.SetActive(config.VipLevel > 0); |
| | | if (config.VipLevel > 0) |
| | | { |
| | | vipImage.SetSprite($"VipLevel{config.VipLevel}"); |
| | | vipText.text = Language.Get($"VipLevelInfo{config.VipLevel}"); |
| | | vipText.color = InvestModel.Instance.GetTextColor(config.VipLevel); |
| | | vipTextOutline.OutlineColor = InvestModel.Instance.GetOutlineColor(config.VipLevel); |
| | | } |
| | | |
| | | rateImage.SetActive(true); |
| | | rateText.text = Language.Get("DailySpecials07", config.Percentage); |
| | | |
| | | bool isCanBuy = manager.IsCanBuy(ctgId, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt); |
| | | titleText.text = config.Title; |
| | | buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale)); |
| | | limitCountText.SetActive(!isNoLimitBuy && maxBuyCnt > 0); |
| | | if (!isNoLimitBuy && maxBuyCnt > 0) |
| | | { |
| | | limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(nowBuyCnt >= maxBuyCnt ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, maxBuyCnt - nowBuyCnt).ToString())); |
| | | } |
| | | buyButton.interactable = isCanBuy; |
| | | buyButton.SetListener(() => |
| | | { |
| | | if (config.VipLevel > 0 && !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.PrivilegeCard)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto8"); |
| | | return; |
| | | } |
| | | if (config.VipLevel == 1 && !InvestModel.Instance.IsInvested(InvestModel.monthCardType)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto5"); |
| | | UIManager.Instance.OpenWindow<PrivilegeCardWin>(); |
| | | return; |
| | | } |
| | | if (config.VipLevel == 2 && !InvestModel.Instance.IsInvested(InvestModel.foreverCardType)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto7"); |
| | | UIManager.Instance.OpenWindow<PrivilegeCardWin>(); |
| | | return; |
| | | } |
| | | 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) |
| | | { |
| | | rateImage.SetActive(false); |
| | | vipImage.SetActive(false); |
| | | if (!StoreConfig.HasKey(id)) return; |
| | | |
| | | StoreConfig storeConfig = StoreConfig.Get(id); |
| | | int remainNum; |
| | | storeModel.TryGetIsSellOut(storeConfig, out remainNum); |
| | | |
| | | bool isFree = manager.IsFreeShop(id); |
| | | titleText.text = storeConfig.Name; |
| | | |
| | | limitCountText.SetActive(!isFree); |
| | | limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, remainNum).ToString(), true)); |
| | | |
| | | bool isCanBuy = manager.IsNoSellOutShopID(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); |
| | | adImage.SetActive(false); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void DisplayAD(int ADID) |
| | | { |
| | | rateImage.SetActive(false); |
| | | vipImage.SetActive(false); |
| | | |
| | | ADAwardConfig config = ADAwardConfig.Get(ADID); |
| | | if (config == null) return; |
| | | bool isCanBuy = manager.IsAdAwardCanReceive(ADID); |
| | | int receivedCnt = AdsManager.Instance.GetADCntByADID(ADID); |
| | | |
| | | titleText.text = config.Name; |
| | | limitCountText.SetActive(true); |
| | | limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(!isCanBuy ? TextColType.Red : TextColType.LightGreen, Mathf.Max(config.ADCntMax - receivedCnt, 0).ToString())); |
| | | redImage.SetActive(isCanBuy); |
| | | buyText.SetActive(false); |
| | | buyText1.SetActive(true); |
| | | buyText1.text = Language.Get("L1127"); |
| | | moneyIconImage.SetActive(false); |
| | | adImage.SetActive(true); |
| | | adImage.gray = !isCanBuy; |
| | | buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | buyButton.interactable = isCanBuy; |
| | | buyButton.SetListener(() => |
| | | { |
| | | AdsManager.Instance.GetAdsAward(ADID); |
| | | }); |
| | | |
| | | var items = config.ADAwardItemList; |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | var itemBaisc = itemCells[i]; |
| | | if (i < items.Length) |
| | | { |
| | | var itemInfo = items[i]; |
| | | itemBaisc.SetActive(true); |
| | | itemBaisc.Init(new ItemCellModel(itemInfo[0], false, itemInfo[1])); |
| | | itemBaisc.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemInfo[0]); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | itemBaisc.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cce6bd2f32961ec42b60c48e47665255 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityGiftWin : UIBase |
| | | { |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] TextEx timeText; |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | StoreModel storeModel => StoreModel.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; |
| | | storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | | CreateGiftScroller(); |
| | | OnSecondEvent(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent; |
| | | storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | | } |
| | | |
| | | private void OnAdsInfoListUpdateEvent(int arg1, int arg2, int arg3) |
| | | { |
| | | RefreshAll(); |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<FestivalActivityGiftCell>(); |
| | | _cell?.Display(cell.index, giftItems); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | manager.GetActTimeStr(timeText); |
| | | } |
| | | |
| | | private void OnRechargeCountEvent(int obj) |
| | | { |
| | | RefreshAll(); |
| | | } |
| | | |
| | | private void RefreshBuyShopLimitEvent() |
| | | { |
| | | RefreshAll(); |
| | | } |
| | | |
| | | List<FestivalActivityGiftItem> giftItems; |
| | | private void CreateGiftScroller() |
| | | { |
| | | giftItems = manager.GetGiftItemList(true); |
| | | scroller.Refresh(); |
| | | if (!giftItems.IsNullOrEmpty()) |
| | | { |
| | | for (int i = 0; i < giftItems.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void RefreshAll() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 030c0370cba35da49bde2e5b27d0c437 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityManager : GameSystemManager<FestivalActivityManager>, IOpenServerActivity |
| | | { |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent; |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent; |
| | | HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent; |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | | InitRedPointId(); |
| | | |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent; |
| | | GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent; |
| | | HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent; |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | | } |
| | | |
| | | private void OnAdsInfoListUpdateEvent(int arg1, int arg2, int arg3) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void OnDayEvent() |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void OnHeroChangeEvent(HeroInfo info) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void OnUpdateActSignInfosEvent(int arg1, int arg2) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void RefreshBuyShopLimitEvent() |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void OnPlayerLoginOk() |
| | | { |
| | | TryPopWin(); |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj != (int)FuncOpenEnum.HeroDebut) |
| | | return; |
| | | TryPopWin(); |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.FestivalActivityAct; |
| | | public static OperationType operaType = OperationType.FestivalActivity; |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint); |
| | | |
| | | 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 = 30; |
| | | public event Action<int> onStateUpdate; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | if (UIManager.Instance.IsOpened<FestivalActivityPopWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityPopWin>(); |
| | | if (UIManager.Instance.IsOpened<FestivalActivityWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityWin>(); |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | onStateUpdate?.Invoke(activityID); |
| | | TryPopWin(); |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | onStateUpdate?.Invoke(activityID); |
| | | if (UIManager.Instance.IsOpened<FestivalActivityPopWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityPopWin>(); |
| | | if (UIManager.Instance.IsOpened<FestivalActivityWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityWin>(); |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | private void OperationAdvanceEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | onStateUpdate?.Invoke(activityID); |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | |
| | | public OperationFlashSaleActivityInfo GetActInfo() |
| | | { |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationFlashSaleActivityInfo act); |
| | | return act; |
| | | } |
| | | #region 红点 |
| | | public int GetRedPointId(FestivalActivityRepointType type) |
| | | { |
| | | return MainRedDot.FestivalActivityRepoint * 10 + (int)type; |
| | | } |
| | | |
| | | public Redpoint shopRedpoint; |
| | | public Redpoint giftRedpoint; |
| | | public Redpoint rechargeRedpoint; |
| | | public void InitRedPointId() |
| | | { |
| | | shopRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, GetRedPointId(FestivalActivityRepointType.Shop)); |
| | | giftRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, GetRedPointId(FestivalActivityRepointType.Gift)); |
| | | rechargeRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, GetRedPointId(FestivalActivityRepointType.Recharge)); |
| | | } |
| | | |
| | | public void UpdateRedpoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | shopRedpoint.state = RedPointState.None; |
| | | giftRedpoint.state = RedPointState.None; |
| | | |
| | | if (ShowShopRedpoint())//商店 |
| | | shopRedpoint.state = RedPointState.Simple; |
| | | |
| | | if (HasGiftCanHave())//礼包 |
| | | giftRedpoint.state = RedPointState.Simple; |
| | | } |
| | | #endregion |
| | | #region 拍脸界面 |
| | | public bool IsTodayPop |
| | | { |
| | | get |
| | | { |
| | | int lastPopTime = LoadPopTimeData(); |
| | | int todayStartTime = TimeUtility.GetTodayStartTick(); |
| | | return lastPopTime < todayStartTime; |
| | | } |
| | | } |
| | | private string PopTimeDataKey { get { return $"FestivalActivityManager_PopTimeData_{PlayerDatas.Instance.PlayerId}"; } } |
| | | |
| | | private int LoadPopTimeData() |
| | | { |
| | | return LocalSave.GetInt(PopTimeDataKey); |
| | | } |
| | | |
| | | public void SavePopTimeData() |
| | | { |
| | | LocalSave.SetInt(PopTimeDataKey, TimeUtility.AllSeconds); |
| | | } |
| | | |
| | | public void ClearPopTimeData() |
| | | { |
| | | LocalSave.SetInt(PopTimeDataKey, 0); |
| | | } |
| | | |
| | | private void TryPopWin() |
| | | { |
| | | if (!IsFestivalActivityOpen()) return; |
| | | if (!IsTodayPop) return; |
| | | if (UIManager.Instance.IsOpened<FestivalActivityPopWin>()) return; |
| | | if (UIManager.Instance.IsOpened<FestivalActivityWin>()) return; |
| | | PopupWindowsProcessor.Instance.Add("FestivalActivityPopWin"); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | public void GetActTimeStr(TextEx timeText, string key = "TimeRush05") |
| | | { |
| | | var act = GetActInfo(); |
| | | if (act == null) |
| | | { |
| | | timeText.text = Language.Get("OSActivity6"); |
| | | return; |
| | | } |
| | | timeText.text = Language.Get(key, TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | |
| | | |
| | | |
| | | public Color32 ParseColor32(int[] colorArr) |
| | | { |
| | | return new Color32() |
| | | { |
| | | r = (byte)(colorArr.Length > 0 ? colorArr[0] : 0), |
| | | g = (byte)(colorArr.Length > 1 ? colorArr[1] : 0), |
| | | b = (byte)(colorArr.Length > 2 ? colorArr[2] : 0), |
| | | a = (byte)(colorArr.Length > 3 ? colorArr[3] : 255), |
| | | }; |
| | | } |
| | | |
| | | public bool IsFestivalActivityOpen() |
| | | { |
| | | if (!IsOpen) return false; |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity)) return false; |
| | | return true; |
| | | } |
| | | |
| | | #region 兑换商店 |
| | | private string ShopVisitTimeDataKey { get { return $"FestivalActivityManager_ShopVisitTime_{PlayerDatas.Instance.PlayerId}"; } } |
| | | |
| | | private int LoadShopVisitTimeData() |
| | | { |
| | | return LocalSave.GetInt(ShopVisitTimeDataKey); |
| | | } |
| | | |
| | | public void SaveShopVisitTimeData() |
| | | { |
| | | LocalSave.SetInt(ShopVisitTimeDataKey, TimeUtility.AllSeconds); |
| | | } |
| | | public bool IsShopVisitedToday |
| | | { |
| | | get |
| | | { |
| | | int lastVisitTime = LoadShopVisitTimeData(); |
| | | int todayStartTime = TimeUtility.GetTodayStartTick(); |
| | | return lastVisitTime >= todayStartTime; |
| | | } |
| | | } |
| | | |
| | | public bool ShowShopRedpoint() |
| | | { |
| | | var act = GetActInfo(); |
| | | if (act == null) |
| | | return false; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return false; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ShopType, out var list) || list.IsNullOrEmpty()) |
| | | return false; |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | var item = list[i]; |
| | | bool isFree = IsFreeShop(item.shopId); |
| | | bool isCanBuy = IsNoSellOutShopID(item.shopId); |
| | | if (isFree && isCanBuy) |
| | | return true; |
| | | } |
| | | |
| | | return !IsShopVisitedToday; |
| | | } |
| | | #endregion |
| | | |
| | | #region 限时礼包 |
| | | public bool IsCanBuy(int ctgID, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt) |
| | | { |
| | | isNoLimitBuy = false; |
| | | nowBuyCnt = 0; |
| | | maxBuyCnt = 0; |
| | | CTGConfig config = CTGConfig.Get(ctgID); |
| | | if (config == null) |
| | | return false; |
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount)) |
| | | return false; |
| | | |
| | | // 所有限制都为0时,无限购买 |
| | | if (config.TotalBuyCount == 0 && config.DailyBuyCount == 0 && |
| | | config.WeekBuyCount == 0 && config.MonthBuyCount == 0) |
| | | { |
| | | isNoLimitBuy = true; |
| | | return true; |
| | | } |
| | | |
| | | // 按优先级检查:每日 > 每周 > 每月 > 总计 |
| | | if (config.DailyBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.todayCount; |
| | | maxBuyCnt = config.DailyBuyCount; |
| | | return rechargeCount.todayCount < config.DailyBuyCount; |
| | | } |
| | | if (config.WeekBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.weekPayCount; |
| | | maxBuyCnt = config.WeekBuyCount; |
| | | return rechargeCount.weekPayCount < config.WeekBuyCount; |
| | | } |
| | | if (config.MonthBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.monthPayCount; |
| | | maxBuyCnt = config.MonthBuyCount; |
| | | return rechargeCount.monthPayCount < config.MonthBuyCount; |
| | | } |
| | | if (config.TotalBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.totalCount; |
| | | maxBuyCnt = config.TotalBuyCount; |
| | | return rechargeCount.totalCount < config.TotalBuyCount; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 免费商品 |
| | | public bool IsFreeShop(int shopID) |
| | | { |
| | | StoreConfig config = StoreConfig.Get(shopID); |
| | | if (config == null) return false; |
| | | return config.MoneyNum == 0; |
| | | } |
| | | |
| | | //没售罄 |
| | | public bool IsNoSellOutShopID(int shopID) |
| | | { |
| | | StoreConfig config = StoreConfig.Get(shopID); |
| | | if (config == null) return false; |
| | | |
| | | StoreModel.Instance.TryGetIsSellOut(config, out int remainNum); |
| | | return remainNum > 0; |
| | | } |
| | | |
| | | public List<FestivalActivityGiftItem> GetGiftItemList(bool isSort = false) |
| | | { |
| | | var act = GetActInfo(); |
| | | if (act == null) return null; |
| | | |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) return null; |
| | | |
| | | List<FestivalActivityGiftItem> res = new List<FestivalActivityGiftItem>(); |
| | | |
| | | var list = StoreModel.Instance.storeTypeDict[config.ActShopType]; |
| | | if (!list.IsNullOrEmpty()) |
| | | { |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | var item = list[i]; |
| | | if (item.storeConfig == null) |
| | | continue; |
| | | res.Add(new FestivalActivityGiftItem |
| | | { |
| | | type = 0, |
| | | id = item.storeConfig.ID, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | var adAwardConfig = ADAwardConfig.Get(config.ADID); |
| | | if (adAwardConfig != null) |
| | | { |
| | | res.Add(new FestivalActivityGiftItem |
| | | { |
| | | type = 1, |
| | | id = config.ADID, |
| | | }); |
| | | } |
| | | |
| | | if (config.CTGIDList != null) |
| | | { |
| | | for (int i = 0; i < config.CTGIDList.Length; i++) |
| | | { |
| | | var item = config.CTGIDList[i]; |
| | | res.Add(new FestivalActivityGiftItem |
| | | { |
| | | type = 2, |
| | | id = item, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (isSort) |
| | | { |
| | | res = res.OrderBy(item => |
| | | { |
| | | bool isCanBuy; |
| | | if (item.type == 0) // 商店 |
| | | { |
| | | isCanBuy = IsNoSellOutShopID(item.id); |
| | | } |
| | | else if (item.type == 1) // 广告 |
| | | { |
| | | isCanBuy = IsAdAwardCanReceive(item.id); |
| | | } |
| | | else // 充值 |
| | | { |
| | | isCanBuy = IsCanBuy(item.id, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt); |
| | | } |
| | | return !isCanBuy; |
| | | }) |
| | | .ThenBy(item => GetSortOrder(item)) |
| | | .ThenBy(item => item.id) |
| | | .ToList(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 广告是否已领取完 |
| | | public bool IsAdAwardCanReceive(int adID) |
| | | { |
| | | var config = ADAwardConfig.Get(adID); |
| | | if (config == null) return false; |
| | | int receivedCnt = AdsManager.Instance.GetADCntByADID(adID); |
| | | return receivedCnt < config.ADCntMax; |
| | | } |
| | | |
| | | private int GetSortOrder(FestivalActivityGiftItem item) |
| | | { |
| | | if (item.type == 0) // 商店 |
| | | { |
| | | return IsFreeShop(item.id) ? 0 : 2; // 免费=0, 元宝=2 |
| | | } |
| | | if (item.type == 1) // 广告 |
| | | { |
| | | return 1; |
| | | } |
| | | return 3; // RMB (type == 2) |
| | | } |
| | | |
| | | |
| | | public bool HasGiftCanHave() |
| | | { |
| | | var list = GetGiftItemList(false); |
| | | if (list.IsNullOrEmpty()) |
| | | return false; |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | var item = list[i]; |
| | | if (item.type == 0) |
| | | { |
| | | bool isFree = IsFreeShop(item.id); |
| | | bool isCanBuy = IsNoSellOutShopID(item.id); |
| | | if (isFree && isCanBuy) |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | var act = GetActInfo(); |
| | | if (act == null) return false; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) return false; |
| | | var adAwardConfig = ADAwardConfig.Get(config.ADID); |
| | | if (adAwardConfig == null) return false; |
| | | |
| | | if (IsAdAwardCanReceive(config.ADID)) |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | public enum FestivalActivityRepointType |
| | | { |
| | | CheckIn = 1, |
| | | Mission = 2, |
| | | Shop = 3, |
| | | Gift = 4, |
| | | Recharge = 5, |
| | | TotalRecharge = 6, |
| | | TotDayRecharge = 7, |
| | | } |
| | | |
| | | public class FestivalActivityGiftItem |
| | | { |
| | | public int type;//0 商店id 1 广告id 2 充值id |
| | | public int id; |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e28bb6a585249d94eabdd1bf556d81e7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class FestivalActivityMissionCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | |
| | | |
| | | public void Display(ActTaskTempConfig config, int taskIndex) |
| | | { |
| | | int targetValue = config.NeedValue; |
| | | uint curValue = FestivalActivityMissionManager.Instance.GetTaskProgress((byte)config.TaskType); |
| | | |
| | | // 使用新的语言键格式 ActTaskType{TaskType} |
| | | nameText.text = Language.Get($"ActTaskType{config.TaskType}", config.NeedValue); |
| | | |
| | | processImg.fillAmount = Mathf.Clamp01((float)curValue / targetValue); |
| | | processText.text = Mathf.Min(targetValue, (int)curValue) + "/" + targetValue; |
| | | |
| | | var state = FestivalActivityMissionManager.Instance.GetTaskState(config.TasklD); |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = config.AwardItemList[i][0]; |
| | | itemCells[i].Init(new ItemCellModel(itemID, false, config.AwardItemList[i][1])); |
| | | itemCells[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | getBtn.SetActive(state == 1); |
| | | gotRect.SetActive(state == 2); |
| | | gotoBtn.SetActive(state == 0); |
| | | |
| | | getBtn.AddListener(() => |
| | | { |
| | | FestivalActivityMissionManager.Instance.SendGetAward(config.TasklD); |
| | | }); |
| | | |
| | | gotoBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.CloseWindow<FestivalActivityWin>(); |
| | | |
| | | if (config.GuideID > 0) |
| | | { |
| | | NewBieCenter.Instance.StartNewBieGuide(config.GuideID); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f1170cec164834e4ab20b21cb2be5cca |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityMissionManager : GameSystemManager<FestivalActivityMissionManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 30; |
| | | |
| | | // 玩家任务进度信息 (差异更新字典: 任务类型 -> 当前任务值) |
| | | private Dictionary<int, uint> taskProgressDict = new Dictionary<int, uint>(); |
| | | public uint ActScoreTotal; // 累计活动积分,用于验证领取累计积分奖励用,商店兑换直接用物品兑换物品 |
| | | public uint ActScoreAward; // 累计活动积分领奖记录,按奖励索引位运算判断是否已领取 |
| | | public byte AwardCount; |
| | | public uint[] AwardRecordList; // 任务ID领奖记录值列表,根据任务ID位判断是否已领取,一个记录值存31位 [记录值0, 记录值1, ...] |
| | | |
| | | 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.FestivalActivity) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | taskProgressDict.Clear(); |
| | | ActScoreTotal = 0; |
| | | ActScoreAward = 0; |
| | | AwardCount = 0; |
| | | AwardRecordList = null; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.FestivalActivityMissionAct; |
| | | public static OperationType operaType = OperationType.FestivalActivity_Mission; |
| | | |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint, FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Mission)); |
| | | |
| | | // 实时获取当前活动配置 |
| | | private ActTaskConfig GetCurrentConfig() |
| | | { |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation)) |
| | | return null; |
| | | return ActTaskConfig.Get(operation.CfgID); |
| | | } |
| | | |
| | | // 实时获取任务模板列表 |
| | | private List<ActTaskTempConfig> GetCurrentTaskList() |
| | | { |
| | | ActTaskConfig config = GetCurrentConfig(); |
| | | if (config == null) |
| | | return null; |
| | | return ActTaskTempConfig.GetTemplateIDToConfigsDict(config.TemplateID); |
| | | } |
| | | |
| | | 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; |
| | | public event Action OnMissionDataChangeEvent; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (type != operaType) |
| | | return; |
| | | |
| | | if (UIManager.Instance.IsOpened<FestivalActivityMissionWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityMissionWin>(); |
| | | |
| | | // 实时获取活动配置 |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation)) |
| | | return; |
| | | |
| | | ActTaskConfig config = ActTaskConfig.Get(operation.CfgID); |
| | | if (config == null) |
| | | return; |
| | | |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OperationStartEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | // 实时获取活动配置 |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation)) |
| | | return; |
| | | |
| | | ActTaskConfig config = ActTaskConfig.Get(operation.CfgID); |
| | | if (config == null) |
| | | return; |
| | | |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(OperationType type, int state) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | if (UIManager.Instance.IsOpened<FestivalActivityMissionWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityMissionWin>(); |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(OperationType type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | // 实时获取活动配置 |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation)) |
| | | return; |
| | | |
| | | ActTaskConfig config = ActTaskConfig.Get(operation.CfgID); |
| | | if (config == null) |
| | | return; |
| | | |
| | | UpdateRedPoint(); |
| | | onStateUpdate?.Invoke(activityID); |
| | | } |
| | | } |
| | | |
| | | public void UpdateRedPoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity)) |
| | | return; |
| | | if (!IsOpen) |
| | | return; |
| | | |
| | | ActTaskConfig config = GetCurrentConfig(); |
| | | if (config == null) |
| | | return; |
| | | |
| | | var taskList = GetCurrentTaskList(); |
| | | if (taskList == null) |
| | | return; |
| | | |
| | | // 检查任务是否有可领取的 |
| | | for (int i = 0; i < taskList.Count; i++) |
| | | { |
| | | if (GetTaskState(taskList[i].TasklD) == 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 检查累计积分奖励是否有可领取的 |
| | | var totalScoreAwardList = ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID); |
| | | for (int i = 0; i < totalScoreAwardList.Count; i++) |
| | | { |
| | | if (GetTotalScoreState(i) == 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 获取任务列表(排序:1可领取 > 0不可领取 > 2已领取) |
| | | public List<ActTaskTempConfig> GetTaskConfigList() |
| | | { |
| | | var taskList = GetCurrentTaskList(); |
| | | if (taskList == null) |
| | | return new List<ActTaskTempConfig>(); |
| | | |
| | | // 按任务状态排序:1可领取 > 0不可领取 > 2已领取 |
| | | return taskList.OrderBy(t => GetTaskState(t.TasklD) == 2) |
| | | .ThenBy(t => GetTaskState(t.TasklD) == 0) |
| | | .ToList(); |
| | | } |
| | | |
| | | // 获取任务状态: 0不可领取 1可领取 2已领取 |
| | | public int GetTaskState(int taskId) |
| | | { |
| | | if (AwardRecordList == null) |
| | | return 0; |
| | | |
| | | var taskList = GetCurrentTaskList(); |
| | | if (taskList == null) |
| | | return 0; |
| | | |
| | | // 检查是否已领取 |
| | | if (IsTaskAwardReceived(taskId)) |
| | | return 2; |
| | | |
| | | // 检查是否达成 |
| | | if (CanReceiveTaskAward(taskId)) |
| | | return 1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | // 检查任务奖励是否已领取 |
| | | private bool IsTaskAwardReceived(int id) |
| | | { |
| | | if (AwardRecordList == null) |
| | | return false; |
| | | var index = id / 31; |
| | | var bit = id % 31; |
| | | return (AwardRecordList[index] & (1u << bit)) != 0; |
| | | } |
| | | |
| | | // 检查任务是否可领取 |
| | | private bool CanReceiveTaskAward(int taskId) |
| | | { |
| | | if (taskProgressDict.Count == 0) |
| | | return false; |
| | | |
| | | var taskList = GetCurrentTaskList(); |
| | | if (taskList == null) |
| | | return false; |
| | | |
| | | var config = taskList.FirstOrDefault(t => t.TasklD == taskId); |
| | | if (config == null) |
| | | return false; |
| | | |
| | | uint currentValue = GetTaskProgress((byte)config.TaskType); |
| | | return currentValue >= (uint)config.NeedValue; |
| | | } |
| | | |
| | | // 获取任务当前进度 |
| | | public uint GetTaskProgress(byte taskType) |
| | | { |
| | | if (taskProgressDict.TryGetValue(taskType, out uint value)) |
| | | return value; |
| | | return 0; |
| | | } |
| | | |
| | | // 获取任务目标值 |
| | | public uint GetTaskTarget(byte taskType) |
| | | { |
| | | var taskList = GetCurrentTaskList(); |
| | | if (taskList == null) |
| | | return 0; |
| | | |
| | | var config = taskList.FirstOrDefault(t => t.TaskType == taskType); |
| | | if (config == null) |
| | | return 0; |
| | | return (uint)config.NeedValue; |
| | | } |
| | | |
| | | // 获取累计积分奖励状态: 0不可领取 1可领取 2已领取 |
| | | public int GetTotalScoreState(int awardIndex) |
| | | { |
| | | if (AwardRecordList == null) |
| | | return 0; |
| | | |
| | | ActTaskConfig config = GetCurrentConfig(); |
| | | if (config == null) |
| | | return 0; |
| | | |
| | | var totalScoreAwardList = ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID); |
| | | if (awardIndex < 0 || awardIndex >= totalScoreAwardList.Count) |
| | | return 0; |
| | | |
| | | // 检查是否已领取 |
| | | if (IsTotalScoreAwardReceived(awardIndex)) |
| | | return 2; |
| | | |
| | | // 检查积分是否足够 |
| | | if (ActScoreTotal >= (uint)totalScoreAwardList[awardIndex].needScore) |
| | | return 1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | // 检查累计积分奖励是否已领取 |
| | | private bool IsTotalScoreAwardReceived(int awardIndex) |
| | | { |
| | | if (AwardRecordList == null) |
| | | return false; |
| | | |
| | | return (ActScoreAward & (1u << awardIndex)) != 0; |
| | | } |
| | | |
| | | // 获取累计积分 |
| | | public uint GetTotalScore() |
| | | { |
| | | return ActScoreTotal; |
| | | } |
| | | |
| | | // 获取累计积分奖励列表 |
| | | public List<ActTaskTempConfig.TotalScoreAwardConfig> GetTotalScoreAwardList() |
| | | { |
| | | ActTaskConfig config = GetCurrentConfig(); |
| | | if (config == null) |
| | | return new List<ActTaskTempConfig.TotalScoreAwardConfig>(); |
| | | return ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID); |
| | | } |
| | | |
| | | // 处理玩家任务进度信息 (HAA72) |
| | | public void UpdatePlayerValueInfo(HAA72_tagSCActTaskPlayerValueInfo info) |
| | | { |
| | | if (ActNum != info.ActNum) |
| | | return; |
| | | |
| | | for (int i = 0; i < info.TaskValueList.Length; i++) |
| | | { |
| | | var taskValue = info.TaskValueList[i]; |
| | | taskProgressDict[(int)taskValue.TaskType] = taskValue.TaskValue; |
| | | } |
| | | UpdateRedPoint(); |
| | | OnMissionDataChangeEvent?.Invoke(); |
| | | } |
| | | |
| | | // 处理玩家奖励领取信息 (HAA73) |
| | | public void UpdatePlayerInfo(HAA73_tagSCActTaskPlayerInfo info) |
| | | { |
| | | if (ActNum != info.ActNum) |
| | | return; |
| | | |
| | | ActScoreTotal = info.ActScoreTotal; |
| | | ActScoreAward = info.ActScoreAward; |
| | | AwardCount = info.AwardCount; |
| | | AwardRecordList = info.AwardRecordList; |
| | | UpdateRedPoint(); |
| | | OnMissionDataChangeEvent?.Invoke(); |
| | | } |
| | | |
| | | // 发送领取任务奖励 |
| | | public void SendGetAward(int taskId) |
| | | { |
| | | string actStr = ActNum.ToString(); |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 71; |
| | | pack.DataEx = (uint)taskId; |
| | | pack.DataExStr = actStr; |
| | | pack.DataExStrLen = (byte)actStr.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | // 发送领取累计积分奖励 |
| | | public void SendGetTotalScoreAward() |
| | | { |
| | | string actStr = ActNum.ToString(); |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 71; |
| | | pack.DataEx = 0; // 0表示领取累计积分奖励 |
| | | pack.DataExStr = actStr; |
| | | pack.DataExStrLen = (byte)actStr.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | public string GetActTimeStr() |
| | | { |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation)) |
| | | { |
| | | return Language.Get("OSActivity6"); |
| | | } |
| | | return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(operation.GetResetSurplusTime())); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 16ba7e2787f697440a4d3ad20ecec557 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 玩个游戏 |
| | | // [ Date ]: Tuesday, July 24, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | ////开服盛典 |
| | | public class FestivalActivityMissionWin : UIBase |
| | | { |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text galaTimeText; |
| | | [SerializeField] Text totalScoreText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Image[] gotImgs; |
| | | [SerializeField] Text[] scoreTexts; |
| | | [SerializeField] UIEffectPlayer[] effectPlayers; |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | List<ActTaskTempConfig> taskConfigs = new List<ActTaskTempConfig>(); |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | | FestivalActivityMissionManager.Instance.OnMissionDataChangeEvent += OnMissionDataChangeEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += ShowTime; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | RefreshScroller(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | FestivalActivityMissionManager.Instance.OnMissionDataChangeEvent -= OnMissionDataChangeEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= ShowTime; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | void OnMissionDataChangeEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | Display(); |
| | | } |
| | | |
| | | void RefreshScroller() |
| | | { |
| | | taskConfigs = FestivalActivityMissionManager.Instance.GetTaskConfigList(); |
| | | var count = taskConfigs.Count; |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as FestivalActivityMissionCell; |
| | | _cell.Display(taskConfigs[cell.index], cell.index); |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | uint totalScore = FestivalActivityMissionManager.Instance.GetTotalScore(); |
| | | var awardList = FestivalActivityMissionManager.Instance.GetTotalScoreAwardList(); |
| | | |
| | | // 进度条计算 |
| | | uint maxScore = 0; |
| | | if (awardList != null && awardList.Count > 0) |
| | | { |
| | | maxScore = (uint)awardList[awardList.Count - 1].needScore; |
| | | } |
| | | |
| | | if (maxScore > 0) |
| | | { |
| | | processImg.fillAmount = Mathf.Clamp01((float)totalScore / maxScore); |
| | | } |
| | | else |
| | | { |
| | | processImg.fillAmount = 0; |
| | | } |
| | | |
| | | ShowTime(); |
| | | totalScoreText.text = Language.Get("OSActivity11") + totalScore.ToString(); |
| | | |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < awardList.Count) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int index = i; |
| | | int itemID = awardList[i].itemId; |
| | | itemCells[i].Init(new ItemCellModel(itemID, false, awardList[i].itemCount)); |
| | | itemCells[i].button.AddListener(() => |
| | | { |
| | | if (FestivalActivityMissionManager.Instance.GetTotalScoreState(index) != 1) |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | return; |
| | | } |
| | | |
| | | FestivalActivityMissionManager.Instance.SendGetTotalScoreAward(); |
| | | }); |
| | | |
| | | gotImgs[i].SetActive(FestivalActivityMissionManager.Instance.GetTotalScoreState(i) == 2); |
| | | scoreTexts[i].text = awardList[i].needScore.ToString(); |
| | | if (FestivalActivityMissionManager.Instance.GetTotalScoreState(i) == 1) |
| | | { |
| | | effectPlayers[i].Play(); |
| | | } |
| | | else |
| | | { |
| | | effectPlayers[i].Stop(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void ShowTime() |
| | | { |
| | | galaTimeText.text = FestivalActivityMissionManager.Instance.GetActTimeStr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8cc4efe602e822743a4ee236fcd0e3d4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityPopCell : CellView |
| | | { |
| | | [SerializeField] ItemCell itemCell; |
| | | public void Display(int index, int[][] popItems) |
| | | { |
| | | if (popItems == null || popItems.Length <= index || index < 0) |
| | | return; |
| | | int itemID = popItems[index][0]; |
| | | int itemCount = popItems[index][1]; |
| | | itemCell.Init(new ItemCellModel(itemID, false, itemCount)); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5698be6bce9f11240b0f8866851956f3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class FestivalActivityPopWin : UIBase |
| | | { |
| | | [SerializeField] TextEx timeText; |
| | | [SerializeField] ButtonEx goButton; |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] Toggle todayPopToggle; |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(CloseWindow); |
| | | goButton.SetListener(() => |
| | | { |
| | | UIManager.Instance.CloseWindow<FestivalActivityPopWin>(); |
| | | if (!UIManager.Instance.IsOpened<FestivalActivityWin>()) |
| | | UIManager.Instance.OpenWindow<FestivalActivityWin>(); |
| | | }); |
| | | todayPopToggle.AddListener((bool value) => |
| | | { |
| | | if (value) |
| | | { |
| | | // 勾选:今日不再弹出 |
| | | manager.SavePopTimeData(); |
| | | } |
| | | else |
| | | { |
| | | // 取消勾选:今日依然可以弹出(重置时间记录) |
| | | manager.ClearPopTimeData(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | todayPopToggle.isOn = !manager.IsTodayPop; |
| | | DisplayTime(); |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as FestivalActivityPopCell; |
| | | _cell.Display(cell.index, popItems); |
| | | } |
| | | int[][] popItems; |
| | | void CreateScroller() |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | return; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return; |
| | | popItems = config.PopItems; |
| | | |
| | | scroller.Refresh(); |
| | | if (popItems != null) |
| | | { |
| | | for (int i = 0; i < popItems.Length; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | |
| | | private void DisplayTime() |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | timeText.text = act == null ? string.Empty : Language.Get("FestivalActivity01", act.ToDisplayTime()); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6a7825299693150499da31b4f94eefbb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | public class FestivalActivityRechargeBaseWin : FunctionsBaseWin |
| | | { |
| | | [SerializeField] TextEx timeText; |
| | | [SerializeField] ButtonEx closeButton; |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | tabButtons[0].redpoint.redpointId = FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotalRecharge); |
| | | tabButtons[1].redpoint.redpointId = FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotDayRecharge); |
| | | OnSecondEvent(); |
| | | } |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | } |
| | | |
| | | protected override void OpenSubUIByTabIndex() |
| | | { |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | currentSubUI = UIManager.Instance.OpenWindow<FestivalActivityRechargeTotalWin>(); |
| | | break; |
| | | case 1: |
| | | currentSubUI = UIManager.Instance.OpenWindow<FestivalActivityRechargeTotDayWin>(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | { |
| | | timeText.text = Language.Get("OSActivity6"); |
| | | return; |
| | | } |
| | | timeText.text = Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2ed22b2a27c50074ab0addf5fe7c945e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class FestivalActivityRechargeTotDayCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImage; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | |
| | | FestivalActivityRechargeTotDayManager manager { get { return FestivalActivityRechargeTotDayManager.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: a0ea141844e14b645b403981c1b265c0 |
| | | 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 FestivalActivityRechargeTotDayManager : GameSystemManager<FestivalActivityRechargeTotDayManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 30; |
| | | 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.FestivalActivityRechargeTotDayAct; |
| | | public static OperationType operaType = OperationType.FestivalActivity_RechargeTotDay; |
| | | // 总奖励 |
| | | public Redpoint redPoint = new Redpoint( |
| | | FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Recharge), |
| | | FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotDayRecharge)); |
| | | 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; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>(); |
| | | 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<FestivalActivityRechargeBaseWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>(); |
| | | 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: 0625bbc16a0d77046b6393549c59b91a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | //开服活动-累充 |
| | | public class FestivalActivityRechargeTotDayWin : UIBase |
| | | { |
| | | [SerializeField] ItemCell totDayRechargeItemCell; |
| | | [SerializeField] TextEx totDayRechargeScoreText; |
| | | [SerializeField] RotationTween totDayRechargeRotationTween; |
| | | [SerializeField] ImageEx totDayRechargeFreeRedImage; |
| | | [SerializeField] ImageEx totDayRechargeHaveImage; |
| | | |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | FestivalActivityRechargeTotDayManager manager { get { return FestivalActivityRechargeTotDayManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | manager.OnTotDayRechargePlayerInfoEvent += OnTotDayRechargePlayerInfoEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | CreateScroller(); |
| | | InitRechargeData(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | manager.OnTotDayRechargePlayerInfoEvent -= OnTotDayRechargePlayerInfoEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | RefreshRechargeData(); |
| | | } |
| | | |
| | | private void OnTotDayRechargePlayerInfoEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | RefreshRechargeData(); |
| | | } |
| | | |
| | | void InitRechargeData() |
| | | { |
| | | var data = manager.GetStoreData(); |
| | | bool isReceived = manager.IsReceived(data.shopId); |
| | | totDayRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt)); |
| | | totDayRechargeItemCell.button.SetListener(() => |
| | | { |
| | | if (!isReceived) |
| | | { |
| | | StoreModel.Instance.SendBuyShopItem(data.storeConfig, 1); |
| | | } |
| | | else |
| | | { |
| | | ItemTipUtility.Show(data.storeConfig.ItemID); |
| | | } |
| | | }); |
| | | |
| | | totDayRechargeHaveImage.SetActive(isReceived); |
| | | totDayRechargeFreeRedImage.SetActive(!isReceived); |
| | | totDayRechargeScoreText.text = Language.Get("TotalRecharge07", manager.totalDays); |
| | | if (!isReceived) |
| | | { |
| | | totDayRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totDayRechargeRotationTween.Stop(); |
| | | totDayRechargeRotationTween.SetStartState(); |
| | | } |
| | | } |
| | | |
| | | void RefreshRechargeData() |
| | | { |
| | | var data = manager.GetStoreData(); |
| | | bool isReceived = manager.IsReceived(data.shopId); |
| | | totDayRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt)); |
| | | totDayRechargeHaveImage.SetActive(isReceived); |
| | | totDayRechargeFreeRedImage.SetActive(!isReceived); |
| | | totDayRechargeScoreText.text = Language.Get("TotalRecharge07", manager.totalDays); |
| | | if (!isReceived) |
| | | { |
| | | totDayRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totDayRechargeRotationTween.Stop(); |
| | | totDayRechargeRotationTween.SetStartState(); |
| | | } |
| | | } |
| | | |
| | | 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 FestivalActivityRechargeTotDayCell; |
| | | _cell.Display(cell.index, showList); |
| | | } |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f977063d346b8f4881b912d1243fbdb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class FestivalActivityRechargeTotalCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImage; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | |
| | | FestivalActivityRechargeTotalManager manager { get { return FestivalActivityRechargeTotalManager.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: 57f1d393b81fe04409bfc2fd5e5ecebc |
| | | 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 FestivalActivityRechargeTotalManager : GameSystemManager<FestivalActivityRechargeTotalManager>, IOpenServerActivity |
| | | { |
| | | public readonly int ActNum = 30; |
| | | 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.FestivalActivity) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | coinTotal = 0; |
| | | awardRecord = 0; |
| | | } |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity; |
| | | public const int activityID = (int)NewDayActivityID.FestivalActivityRechargeTotalAct; |
| | | public static OperationType operaType = OperationType.FestivalActivity_RechargeTotal; |
| | | // 总奖励 |
| | | public Redpoint redPoint = new Redpoint( |
| | | FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Recharge), |
| | | FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotalRecharge)); |
| | | 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; |
| | | |
| | | private void OperationTimeUpdateEvent(OperationType type) |
| | | { |
| | | if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>(); |
| | | 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<FestivalActivityRechargeBaseWin>()) |
| | | UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>(); |
| | | 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.FestivalActivity)) |
| | | 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: bcf0ceb7f1a7c8245afc8842e15ce2a3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityRechargeTotalWin : UIBase |
| | | { |
| | | [SerializeField] ItemCell totalRechargeItemCell; |
| | | [SerializeField] TextEx totalRechargeScoreText; |
| | | [SerializeField] RotationTween totalRechargeRotationTween; |
| | | [SerializeField] ImageEx totalRechargeFreeRedImage; |
| | | [SerializeField] ImageEx totalRechargeHaveImage; |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | FestivalActivityRechargeTotalManager manager { get { return FestivalActivityRechargeTotalManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | manager.OnTotalRechargePlayerInfoEvent += OnTotalRechargePlayerInfoEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent; |
| | | CreateScroller(); |
| | | InitRechargeData(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | manager.OnTotalRechargePlayerInfoEvent -= OnTotalRechargePlayerInfoEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent; |
| | | } |
| | | |
| | | private void OnRefreshBuyShopLimitEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | RefreshRechargeData(); |
| | | } |
| | | |
| | | private void OnTotalRechargePlayerInfoEvent() |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | RefreshRechargeData(); |
| | | } |
| | | |
| | | void InitRechargeData() |
| | | { |
| | | var data = manager.GetStoreData(); |
| | | bool isReceived = manager.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); |
| | | totalRechargeScoreText.text = Language.Get("TotalRecharge06", manager.coinTotal); |
| | | if (!isReceived) |
| | | { |
| | | totalRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totalRechargeRotationTween.Stop(); |
| | | totalRechargeRotationTween.SetStartState(); |
| | | } |
| | | } |
| | | |
| | | void RefreshRechargeData() |
| | | { |
| | | var data = manager.GetStoreData(); |
| | | bool isReceived = manager.IsReceived(data.shopId); |
| | | totalRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt)); |
| | | totalRechargeHaveImage.SetActive(isReceived); |
| | | totalRechargeFreeRedImage.SetActive(!isReceived); |
| | | totalRechargeScoreText.text = Language.Get("TotalRecharge06", manager.coinTotal); |
| | | if (!isReceived) |
| | | { |
| | | totalRechargeRotationTween.Play(); |
| | | } |
| | | else |
| | | { |
| | | totalRechargeRotationTween.Stop(); |
| | | totalRechargeRotationTween.SetStartState(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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 FestivalActivityRechargeTotalCell; |
| | | _cell.Display(cell.index, showList); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1a033d0838bfdfb468b0885f494be34b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class FestivalActivityShopCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Transform saleRect; |
| | | [SerializeField] Text saleText; |
| | | [SerializeField] Text itemName; |
| | | [SerializeField] ItemCell itemCell; |
| | | [SerializeField] Text limitText; |
| | | [SerializeField] Text lockTip; |
| | | |
| | | [SerializeField] Transform priceRect; |
| | | [SerializeField] Image priceIcon; |
| | | [SerializeField] Text priceText; |
| | | |
| | | [SerializeField] Transform priceRect1;//居中位置的价格 |
| | | [SerializeField] Image priceIcon1; |
| | | [SerializeField] Text priceText1; |
| | | |
| | | [SerializeField] Transform salePriceRect; |
| | | [SerializeField] Text salePriceText; |
| | | [SerializeField] Button buyButton; |
| | | [SerializeField] Image freeRedPoint; |
| | | [SerializeField] Text freeText; |
| | | [SerializeField] Image exclusiveImage;//专属 |
| | | [SerializeField] Image sellOutImage;//售罄 |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | public void Display(int index) |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | return; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ShopType, out var list)) |
| | | return; |
| | | |
| | | var storeData = list[index]; |
| | | int shopID = storeData.shopId; |
| | | var itemID = storeData.storeConfig.ItemID; |
| | | var itemCount = storeData.storeConfig.ItemCnt; |
| | | exclusiveImage.SetActive(storeData.storeConfig.IsExclusive == 1); |
| | | itemCell.Init(new ItemCellModel(itemID, false, itemCount)); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | var itemConfig = ItemConfig.Get(itemID); |
| | | itemName.text = itemConfig.ItemName; |
| | | |
| | | //折扣 |
| | | if (storeData.storeConfig.MoneyOriginal != 0) |
| | | { |
| | | saleRect.SetActive(true); |
| | | saleText.text = Language.Get("storename5", (storeData.storeConfig.MoneyNum * 10 / (float)storeData.storeConfig.MoneyOriginal).ToString("0.#")); |
| | | } |
| | | else |
| | | { |
| | | saleRect.SetActive(false); |
| | | } |
| | | |
| | | |
| | | var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(shopID); |
| | | string limitStr = ""; |
| | | if (storeData.storeConfig.MoneyNum == 0) |
| | | { |
| | | //免费 |
| | | limitStr = ""; |
| | | } |
| | | else if (storeData.storeConfig.ResetType == 0) |
| | | { |
| | | //限购 |
| | | limitStr = storeData.storeConfig.LimitCnt > 0 ? Language.Get("storename8", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt) : ""; |
| | | } |
| | | else if (storeData.storeConfig.ResetType == 1) |
| | | { |
| | | //每日限购 |
| | | limitStr = Language.Get("storename6", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt); |
| | | } |
| | | else if (storeData.storeConfig.ResetType == 2) |
| | | { |
| | | //每周限购 |
| | | limitStr = Language.Get("storename7", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt); |
| | | } |
| | | |
| | | limitText.text = buyCnt >= storeData.storeConfig.LimitCnt ? UIHelper.AppendColor(TextColType.Gray, limitStr) : limitStr; |
| | | buyButton.AddListener(() => { BuyGoods(shopID); }); |
| | | |
| | | |
| | | //0可购买 1已售罄 2免费 3未解锁 |
| | | var state = StoreModel.Instance.GetShopIDState(shopID); |
| | | sellOutImage.SetActive(state == 1); |
| | | freeRedPoint.SetActive(state == 2); |
| | | lockTip.text = state == 3 ? Language.Get("storename10", storeData.storeConfig.UnlockValue) : string.Empty; |
| | | |
| | | priceRect.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal != 0); |
| | | priceRect1.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal == 0); |
| | | freeText.SetActive(state == 2 || (state == 1 && storeData.storeConfig.MoneyOriginal == 0)); |
| | | salePriceRect.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal != 0); |
| | | |
| | | priceText.text = storeData.storeConfig.MoneyNum.ToString(); |
| | | priceText1.text = storeData.storeConfig.MoneyNum.ToString(); |
| | | |
| | | if (storeData.storeConfig.MoneyType <= 0) |
| | | { |
| | | priceIcon.SetItemSprite(storeData.storeConfig.CostItemID); |
| | | priceIcon1.SetItemSprite(storeData.storeConfig.CostItemID); |
| | | } |
| | | else |
| | | { |
| | | priceIcon.SetIconWithMoneyType(storeData.storeConfig.MoneyType); |
| | | priceIcon1.SetIconWithMoneyType(storeData.storeConfig.MoneyType); |
| | | } |
| | | |
| | | salePriceText.text = storeData.storeConfig.MoneyOriginal.ToString(); |
| | | } |
| | | |
| | | void BuyGoods(int shopID) |
| | | { |
| | | var state = StoreModel.Instance.GetShopIDState(shopID); |
| | | if (state == 1) return; |
| | | |
| | | if (state == 2) |
| | | { |
| | | StoreModel.Instance.SendBuyShopItem(StoreConfig.Get(shopID), 1); |
| | | } |
| | | else |
| | | { |
| | | StoreModel.Instance.buyShopID = shopID; |
| | | UIManager.Instance.OpenWindow<BuyItemWin>(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab9f2879e44d2a42ab352d11f5254fd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityShopLineCell : CellView |
| | | { |
| | | [SerializeField] FestivalActivityShopCell[] storeCells; |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | public void Display(int index) |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | return; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ShopType, out var list)) |
| | | return; |
| | | |
| | | for (int i = 0; i < storeCells.Length; i++) |
| | | { |
| | | if (index + i < list.Count) |
| | | { |
| | | storeCells[i].SetActive(true); |
| | | storeCells[i].Display(index + i); |
| | | } |
| | | else |
| | | { |
| | | storeCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6bd33c42e26241b47987559017eaa303 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class FestivalActivityShopWin : UIBase |
| | | { |
| | | [SerializeField] OwnItemCell ownItemCell; |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] TextEx timeText; |
| | | [SerializeField] ScrollerController scroller; |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | StoreModel.Instance.RefreshShopEvent += CreateScroller; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += CreateScroller; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | if (!manager.IsShopVisitedToday) |
| | | { |
| | | manager.SaveShopVisitTimeData(); |
| | | manager.UpdateRedpoint(); |
| | | } |
| | | |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | return; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return; |
| | | |
| | | ownItemCell.itemID = config.ShopItemID; |
| | | |
| | | CreateScroller(); |
| | | OnSecondEvent(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | StoreModel.Instance.RefreshShopEvent -= CreateScroller; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= CreateScroller; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | StoreModel.Instance.selectStoreFuncType = StoreFunc.Normal; |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as FestivalActivityShopLineCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | manager.GetActTimeStr(timeText); |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | return; |
| | | var config = ActSpecialSaleConfig.Get(act.CfgID); |
| | | if (config == null) |
| | | return; |
| | | if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ShopType, out var list)) |
| | | return; |
| | | |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | if (i % 3 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | |
| | | scroller.Restart(); |
| | | scroller.lockType = EnhanceLockType.KeepVertical; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f29a66f9d8794c342bce21767d912ecd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | public class FestivalActivityWin : UIBase |
| | | { |
| | | [SerializeField] ImageEx bgImage; |
| | | [SerializeField] TextEx timeText; |
| | | |
| | | [SerializeField] ButtonEx closeButton; |
| | | [SerializeField] ButtonEx checkInButton; |
| | | [SerializeField] ButtonEx missionButton; |
| | | [SerializeField] ButtonEx shopButton; |
| | | [SerializeField] ButtonEx giftButton; |
| | | [SerializeField] ButtonEx rechargeButton; |
| | | [SerializeField] ButtonEx previewButton; |
| | | |
| | | [SerializeField] RedpointBehaviour checkInRedpoint; |
| | | [SerializeField] RedpointBehaviour missionRedpoint; |
| | | [SerializeField] RedpointBehaviour shopRedpoint; |
| | | [SerializeField] RedpointBehaviour giftRedpoint; |
| | | [SerializeField] RedpointBehaviour rechargeRedpoint; |
| | | |
| | | FestivalActivityManager manager => FestivalActivityManager.Instance; |
| | | protected override void InitComponent() |
| | | { |
| | | closeButton.SetListener(() => UIManager.Instance.CloseWindow<FestivalActivityWin>()); |
| | | checkInButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityCheckInWin>()); |
| | | missionButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityMissionWin>()); |
| | | shopButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityShopWin>()); |
| | | giftButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityGiftWin>()); |
| | | rechargeButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityRechargeBaseWin>()); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | InitRedpoint(); |
| | | |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += Display; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= Display; |
| | | } |
| | | |
| | | private void OnRechargeCountEvent(int obj) |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | public void InitRedpoint() |
| | | { |
| | | checkInRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.CheckIn); |
| | | missionRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Mission); |
| | | shopRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Shop); |
| | | giftRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Gift); |
| | | rechargeRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Recharge); |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | | |
| | | OnSecondEvent(); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | var act = manager.GetActInfo(); |
| | | if (act == null) |
| | | { |
| | | timeText.text = Language.Get("OSActivity6"); |
| | | return; |
| | | } |
| | | timeText.text = Language.Get("FestivalActivity02", act.ToDisplayTimeEx(), TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime())); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bd54e7e15919c3a409eab1cb99dbfab5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | |
| | | public class OperationCheckInActivityInfo : OperationBase |
| | | { |
| | | public int ActType; // 活动类型,用于关联活动相关模块用,如签到、任务等 |
| | | public int CfgID; // 活动时间表配置ID |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay(false)); |
| | | textBuilder.Append(" 00:00:00"); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("-"); |
| | | textBuilder.Append(endDate.ToDisplay(false)); |
| | | textBuilder.Append(" 23:59:59"); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: df08f6c5862454d4c8a24d44af3a84f0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | |
| | | public class OperationFlashSaleActivityInfo : OperationBase |
| | | { |
| | | public int ActType; // 活动类型,用于关联活动相关模块用,如签到、任务等 |
| | | public int CfgID; // 活动时间表配置ID |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay(false)); |
| | | textBuilder.Append(" 00:00:00"); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("-"); |
| | | textBuilder.Append(endDate.ToDisplay(false)); |
| | | textBuilder.Append(" 23:59:59"); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | public string ToDisplayTimeEx() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay(false)); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("-"); |
| | | textBuilder.Append(endDate.ToDisplay(false)); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 546d13d472461714fa4e45fd54742409 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | |
| | | public class OperationMissionActivityInfo : OperationBase |
| | | { |
| | | public int ActType; // 活动类型,用于关联活动相关模块用,如签到、任务等 |
| | | public int CfgID; // 活动时间表配置ID |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay(false)); |
| | | textBuilder.Append(" 00:00:00"); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("-"); |
| | | textBuilder.Append(endDate.ToDisplay(false)); |
| | | textBuilder.Append(" 23:59:59"); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: afebd8558abc1734fbb2a360b7da975c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] TimeRushCell timeRushCell; |
| | | [SerializeField] HeroDebutCell heroDebutCell; |
| | | [SerializeField] HeroReturnCell heroReturnCell; |
| | | [SerializeField] Button festivalActivityBtn; |
| | | |
| | | //坐骑 |
| | | [SerializeField] Image horseBGImg; |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<DailySpecialsBaseWin>(); |
| | | }); |
| | | |
| | | festivalActivityBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<FestivalActivityWin>(); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | DisplayTimeRush(); |
| | | DisplayHeroDebut(); |
| | | DisplayHeroReturn(); |
| | | DisplayFestivalActivity(); |
| | | DelayPlayMusic().Forget(); |
| | | |
| | | } |
| | |
| | | { |
| | | DisplayGalaBtn(); |
| | | } |
| | | else if (type == OperationType.FestivalActivity) |
| | | { |
| | | DisplayFestivalActivity(); |
| | | } |
| | | } |
| | | |
| | | private void OpenServerActivityStateChange() |
| | |
| | | DisplayHeroDebut(); |
| | | DisplayHeroReturn(); |
| | | DisplayGalaBtn(); |
| | | DisplayFestivalActivity(); |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | |
| | | { |
| | | DisplayHeroReturn(); |
| | | } |
| | | else if (funcId == (int)FuncOpenEnum.FestivalActivity) |
| | | { |
| | | DisplayFestivalActivity(); |
| | | } |
| | | } |
| | | |
| | | private void OnUpdateFirstChargeInfo() |
| | |
| | | return; |
| | | heroReturnCell.Display(); |
| | | } |
| | | |
| | | void DisplayFestivalActivity() |
| | | { |
| | | bool isOpen = FestivalActivityManager.Instance.IsFestivalActivityOpen(); |
| | | festivalActivityBtn.SetActive(isOpen); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | |
|
| | | public void UpdateActTotalRechargeInfo(HAA1D_tagSCActTotalRechargeInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(OperationType.TotalRecharge, out operationBase);
|
| | | var opreationType = OperationType.TotalRecharge;
|
| | | switch (package.ActNum)
|
| | | {
|
| | | case 10:
|
| | | opreationType = OperationType.TotalRecharge;
|
| | | break;
|
| | | case 30:
|
| | | opreationType = OperationType.FestivalActivity_RechargeTotal;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(OperationType.TotalRecharge);
|
| | | ForceStopOperation(opreationType);
|
| | | return;
|
| | | }
|
| | | 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);
|
| | | }
|
| | | if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
|
| | | {
|
| | | operationBase = new OperationTotalRechargeInfo();
|
| | | operationDict.Add(opreationType, 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;
|
| | | }
|
| | | operation.dayReset = config.IsDayReset == 1;
|
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | public void UpdateActTotDayRechargeInfo(HAA1B_tagSCActTotDayRechargeInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(OperationType.TotDayRecharge, out operationBase);
|
| | | var opreationType = OperationType.TotDayRecharge;
|
| | | switch (package.ActNum)
|
| | | {
|
| | | case 10:
|
| | | opreationType = OperationType.TotDayRecharge;
|
| | | break;
|
| | | case 30:
|
| | | opreationType = OperationType.FestivalActivity_RechargeTotDay;
|
| | | break;
|
| | | }
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(OperationType.TotDayRecharge);
|
| | | ForceStopOperation(opreationType);
|
| | | return;
|
| | | }
|
| | | else
|
| | | if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
|
| | | {
|
| | | 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);
|
| | | operationBase = new OperationTotDayRechargeInfo();
|
| | | operationDict.Add(opreationType, 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;
|
| | |
|
| | | if (ActTotDayRechargeConfig.Get(package.CfgID) == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | public void UpdateFlashSaleActivityInfo(HAA10_tagSCActSpecialSaleInfo package)
|
| | | {
|
| | | var opreationType = OperationType.FestivalActivity;
|
| | | switch (package.ActNum)
|
| | | {
|
| | | case 30:
|
| | | opreationType = OperationType.FestivalActivity;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(opreationType);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
|
| | | {
|
| | | operationBase = new OperationFlashSaleActivityInfo();
|
| | | operationDict.Add(opreationType, operationBase);
|
| | | }
|
| | | OperationFlashSaleActivityInfo operation = operationBase as OperationFlashSaleActivityInfo;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.ActNum = package.ActNum;
|
| | | operation.CfgID = package.CfgID;
|
| | |
|
| | | if (ActSpecialSaleConfig.Get(package.CfgID) == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | public void UpdateCheckInActivityInfo(HAA23_tagSCActSignInfo package)
|
| | | {
|
| | | var opreationType = OperationType.FestivalActivity_CheckIn;
|
| | | switch (package.ActNum)
|
| | | {
|
| | | case 30:
|
| | | opreationType = OperationType.FestivalActivity_CheckIn;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(opreationType);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
|
| | | {
|
| | | operationBase = new OperationCheckInActivityInfo();
|
| | | operationDict.Add(opreationType, operationBase);
|
| | | }
|
| | | OperationCheckInActivityInfo operation = operationBase as OperationCheckInActivityInfo;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.ActType = package.ActNum;
|
| | | operation.CfgID = package.CfgID;
|
| | |
|
| | | if (ActSignConfig.Get(package.CfgID) == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | public void UpdateMissionActivityInfo(HAA71_tagSCActTaskInfo package)
|
| | | {
|
| | | var opreationType = OperationType.FestivalActivity_Mission;
|
| | | switch (package.ActNum)
|
| | | {
|
| | | case 30:
|
| | | opreationType = OperationType.FestivalActivity_Mission;
|
| | | break;
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(opreationType);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
|
| | | {
|
| | | operationBase = new OperationMissionActivityInfo();
|
| | | operationDict.Add(opreationType, operationBase);
|
| | | }
|
| | | OperationMissionActivityInfo operation = operationBase as OperationMissionActivityInfo;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.ActType = package.ActNum;
|
| | | operation.CfgID = package.CfgID;
|
| | |
|
| | | var config = ActTaskConfig.Get(package.CfgID);
|
| | | if (config == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
|
| | | return;
|
| | | }
|
| | | operation.dayReset = config.IsDayReset == 1;
|
| | | operationTimeUpdateEvent?.Invoke(opreationType);
|
| | | }
|
| | |
|
| | | // public void UpdateActYunShiInfo(HAA87_tagMCActYunshiInfo package)
|
| | |
| | | HeroReturn = 3, //日期型活动 - 武将返场
|
| | | TotalRecharge = 4,//累充活动
|
| | | TotDayRecharge = 5, //累充天活动
|
| | | FestivalActivity = 6, //节日活动
|
| | | FestivalActivity_RechargeTotDay = 7, //节日活动-累天充值
|
| | | FestivalActivity_RechargeTotal = 8, //节日活动-累充值
|
| | | FestivalActivity_CheckIn = 9, //节日活动-签到
|
| | | FestivalActivity_Mission = 10, //节日活动-任务
|
| | | max,
|
| | | } |
| | |
| | | public const int RedPoint_OSHeroTrain = 481;
|
| | | public const int RedPoint_OSBeautyMM = 482;
|
| | | public const int RedPoint_OSMingge = 483;
|
| | | public const int HeroReturnRepoint = 484; //武将返场
|
| | | public const int HeroReturnRepoint = 484; //武将返场
|
| | | public const int FestivalActivityRepoint = 485; //节日活动
|
| | | public void Register()
|
| | | {
|
| | |
|
| | |
| | | Qunying = 62, //群英榜 |
| | | HeroDebut = 63,//武将登场 |
| | | HeroReturn = 64, //武将返场 |
| | | FestivalActivity = 65,//节日活动 |
| | | } |
| | | |
| | | |
| | |
| | | TimeRushAct = 200, //轮回殿(武将冲刺) |
| | | HeroDebutAct = 201, //英雄登场活动 |
| | | HeroReturnAct = 202, //英雄返场活动 |
| | | TotalRechargeAct = 4, //累充活动 |
| | | TotDayRechargeAct = 5, //累充天活动 |
| | | TotalRechargeAct = 203, //累充活动 |
| | | TotDayRechargeAct = 204, //累充天活动 |
| | | FestivalActivityAct = 205, //节日活动 |
| | | FestivalActivityRechargeTotalAct = 206, |
| | | FestivalActivityRechargeTotDayAct = 207, |
| | | FestivalActivityCheckInAct = 208, |
| | | FestivalActivityMissionAct = 209, //节日活动-任务 |
| | | } |
| | | |
| | | //仙玉购买的二次确认框类型 |