| 123456789101112131415161718192021222324252627282930313233343536373839 | 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 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];            }        }    }}
 |