RedDotDataManager.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }
  40. }