RedDotDataManager.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public class RedDotDataManager : SingletonBase<RedDotDataManager>
  5. {
  6. /// <summary>
  7. /// 公告
  8. /// 是否有未读公告
  9. /// </summary>
  10. /// <returns></returns>
  11. public bool GetNoticeRed()
  12. {
  13. List<NoticeInfo> noticeInfos = NoticeDataManager.Instance.NoticeInfos;
  14. for (int i = 0; i < noticeInfos.Count; i++)
  15. {
  16. if (noticeInfos[i].readStatus == false) return true;
  17. }
  18. return false;
  19. }
  20. /// <summary>
  21. /// 任务
  22. /// 是否有任务奖励、任务宝箱奖励可领
  23. /// </summary>
  24. /// <returns></returns>
  25. public bool GetTaskRed()
  26. {
  27. Dictionary<int, TaskInfo> taskInfo = DailyTaskDataManager.Instance.TaskInfo;
  28. foreach (int key in taskInfo.Keys)
  29. {
  30. if (DailyTaskDataManager.Instance.GetTaskStateById(key) == ConstBonusStatus.CAN_GET) return true;
  31. }
  32. Dictionary<int, int> livenessBoxInfos = DailyTaskDataManager.Instance.LivenessBoxInfos;
  33. foreach (int key in livenessBoxInfos.Keys)
  34. {
  35. if (DailyTaskDataManager.Instance.GetBoxStateById(key) == ConstBonusStatus.CAN_GET) return true;
  36. }
  37. return false;
  38. }
  39. /// <summary>
  40. /// 七天签到
  41. /// </summary>
  42. /// <returns></returns>
  43. public bool GetDailyLoginRed()
  44. {
  45. return ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.CAN_GET;
  46. }
  47. /// <summary>
  48. /// 有邮件未读或未领奖励
  49. /// </summary>
  50. /// <returns></returns>
  51. public bool GetMailRed()
  52. {
  53. if (MailDataManager.Instance.UnreadCount > 0) return true;
  54. return false;
  55. }
  56. }
  57. }