ChatDataManager.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections.Generic;
  2. using ET;
  3. using UnityEngine;
  4. namespace GFGGame
  5. {
  6. public class ChatDataManager : SingletonBase<ChatDataManager>
  7. {
  8. public Dictionary<int, List<ChatData>> ChatDatas = new Dictionary<int, List<ChatData>>();//int:ChatType
  9. public Dictionary<long, List<ChatData>> PrivateChatDatas = new Dictionary<long, List<ChatData>>();//int:RoleId
  10. public bool NewChatInfo = false; //ÓÐеÄÑż¯ÁÄÌìÐÅÏ¢
  11. public void Clear()
  12. {
  13. ChatDatas.Clear();
  14. PrivateChatDatas.Clear();
  15. }
  16. public List<ChatData> GetChatDatas(long type)
  17. {
  18. if (type == ChatType.Private)
  19. {
  20. if (!PrivateChatDatas.ContainsKey(type))
  21. {
  22. PrivateChatDatas[type] = new List<ChatData>();
  23. }
  24. return PrivateChatDatas[type];
  25. }
  26. else
  27. {
  28. if (!ChatDatas.ContainsKey((int)type))
  29. {
  30. ChatDatas[(int)type] = new List<ChatData>();
  31. }
  32. return ChatDatas[(int)type];
  33. }
  34. }
  35. }
  36. }