12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System.Collections.Generic;
- using ET;
- using UnityEngine;
- namespace GFGGame
- {
- public class ChatDataManager : SingletonBase<ChatDataManager>
- {
- public Dictionary<int, List<ChatData>> ChatDatas = new Dictionary<int, List<ChatData>>();//int:ChatType
- public Dictionary<long, List<ChatData>> PrivateChatDatas = new Dictionary<long, List<ChatData>>();//int:RoleId
- public bool NewChatInfo = false; //ÓÐеÄÑż¯ÁÄÌìÐÅÏ¢
- public void Clear()
- {
- ChatDatas.Clear();
- PrivateChatDatas.Clear();
- }
- public List<ChatData> GetChatDatas(long type)
- {
- if (type == ChatType.Private)
- {
- if (!PrivateChatDatas.ContainsKey(type))
- {
- PrivateChatDatas[type] = new List<ChatData>();
- }
- return PrivateChatDatas[type];
- }
- else
- {
- if (!ChatDatas.ContainsKey((int)type))
- {
- ChatDatas[(int)type] = new List<ChatData>();
- }
- return ChatDatas[(int)type];
- }
- }
- }
- }
|