using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public class DayRemind { private static DayRemind m_Instance = null; public static DayRemind Instance { get { if (m_Instance == null) { m_Instance = new DayRemind(); } return m_Instance; } } protected DayRemind() { GetPlayerDayRemind(); DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += AfterPlayerDataInitializeEvent; } private void AfterPlayerDataInitializeEvent() { GetPlayerDayRemind(); } public const string DUNGEON_TRIAL_TIP = "DungeonTrialTip"; public const string DUNGEON_DEMON_TIP = "DungeonDemonTip"; public const string DUNGEON_RELIC_TIP = "DungeonRelic"; public const string OSGIFT_TIP = "OSGift"; public const string RECHARGE_GIFT_TIP = "RechargeGiftTip"; public const string LOGIN_AD_TIP = "LoginAdTip"; public const string PASS_SKILL_REDPOINT = "PassSkillRedpoint"; public const string VIP_GIFT_REDPOINT = "VipGiftRedpoint"; public const string POTENTIAL_NO_NOTIFY = "PotentialNoNotify"; public const string FLASHSALE_REDPOINT = "FlashSale_Redpoint"; public const string OSTIMEGIFT_REDPOINT = "OSTimeGift_Redpoint"; public const string TASK_SKILL_HOLE = "TaskSkillHole"; public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole"; public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint"; public const string FAIRYGRABBOSS_NOTICE_REDPOINT = "FairyGrabBossRedpoint"; public const string TEAM_TICKET_FAIRYLAND = "TeamTicketFairyLand"; public const string FESTIVALREDPACKREMIND = "FestivalRedpackRemind"; public const string EQUIPTRAIN_COSTDIAMOND = "EquipTrain_CostDiamond"; public const string AUCTION_REDPOINT = "Auction_Redpoint"; public const string EQUIPSTRENGTH_REDPOINT = "EquipStrength_Redpoint"; public const string SHIFTEQUIPREMIND1 = "ShiftEquipRemind1"; public const string SHIFTEQUIPREMIND2 = "ShiftEquipRemind2"; public const string DAILYREALMREDPOINT = "DailyRealmRedpoint"; public const string EQUIPGEMUSEGOLD = "EquipGem_UseGold"; public const string SUPERUPGIFTS = "SuperUPGifts"; public const string WORD_YY_REDPOINT = "wordyyredpoint"; // 集字活动红点 public const string CZBM_REDPOINT = "czbmredpoint"; // 成长必买红点 public const string DJQTip = "DJQTip"; // 代金券提示 public Dictionary dayRemindDic = new Dictionary(); public bool GetDayRemind(string _remindKey) { int[] intarray = null; dayRemindDic.TryGetValue(_remindKey, out intarray); if (intarray == null) { SetDayRemind(_remindKey); } if (intarray != null && intarray.Length == 3) { if (intarray[0] != TimeUtility.ServerNow.Month || intarray[1] != TimeUtility.ServerNow.Day) { SetDayRemind(_remindKey, false); return false; } return intarray[2] == 1; } return false; } public void SetDayRemind(string _remindKey, bool _remind) { int[] intarray = null; dayRemindDic.TryGetValue(_remindKey, out intarray); if (intarray == null) { intarray = new int[3]; dayRemindDic[_remindKey] = intarray; } intarray[0] = TimeUtility.ServerNow.Month; intarray[1] = TimeUtility.ServerNow.Day; intarray[2] = _remind ? 1 : 0; LocalSave.SetIntArray(StringUtility.Contact(_remindKey, PlayerDatas.Instance.baseData.PlayerID), intarray); } private void GetPlayerDayRemind() { SetDayRemind(DUNGEON_TRIAL_TIP); SetDayRemind(DUNGEON_DEMON_TIP); SetDayRemind(DUNGEON_RELIC_TIP); SetDayRemind(OSGIFT_TIP); SetDayRemind(RECHARGE_GIFT_TIP); SetDayRemind(LOGIN_AD_TIP); //SetDayRemind(PASS_SKILL_REDPOINT); SetDayRemind(VIP_GIFT_REDPOINT); SetDayRemind(POTENTIAL_NO_NOTIFY); SetDayRemind(FLASHSALE_REDPOINT); SetDayRemind(OSTIMEGIFT_REDPOINT); SetDayRemind(TASK_SKILL_HOLE); SetDayRemind(RUNE_SPECIAL_HOLE); SetDayRemind(LEAGUE_NOTICE_REDPOINT); SetDayRemind(FAIRYGRABBOSS_NOTICE_REDPOINT); SetDayRemind(TEAM_TICKET_FAIRYLAND); SetDayRemind(FESTIVALREDPACKREMIND); SetDayRemind(EQUIPTRAIN_COSTDIAMOND); SetDayRemind(AUCTION_REDPOINT); SetDayRemind(EQUIPSTRENGTH_REDPOINT); SetDayRemind(SHIFTEQUIPREMIND1); SetDayRemind(SHIFTEQUIPREMIND2); SetDayRemind(DAILYREALMREDPOINT); SetDayRemind(EQUIPGEMUSEGOLD); SetDayRemind(SUPERUPGIFTS); SetDayRemind(WORD_YY_REDPOINT); SetDayRemind(CZBM_REDPOINT); SetDayRemind(DJQTip); } public void SetDayRemind(string _key) { var intarray = LocalSave.GetIntArray(StringUtility.Contact(_key, PlayerDatas.Instance.baseData.PlayerID)); if (dayRemindDic.ContainsKey(_key)) { dayRemindDic[_key] = intarray; return; } dayRemindDic.Add(_key, intarray); } }