using Snxxz.UI; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace EnhancedUI.EnhancedScroller { public class ChatTrailCell : ScrollerUI { [SerializeField] Image chatIcon; [SerializeField] RichText chatText; ChatCenter m_ChatCenter; ChatCenter chatCenter { get { return m_ChatCenter ?? (m_ChatCenter = ModelCenter.Instance.GetModel()); } } public override void Refresh(CellView cell) { ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); if (_data == null) { return; } if (_data.infoList != null) { chatText.SetExtenalData(_data.infoList); } chatIcon.gameObject.SetActive(true); if (_data.type == ChatInfoType.Invite) { chatIcon.SetSprite("ChatIcon_Invite"); } else if (_data.type == ChatInfoType.System) { chatIcon.SetSprite("ChatIcon_System"); } else if (_data.type == ChatInfoType.Friend) { chatIcon.SetSprite("ChatIcon_System"); } else { chatIcon.gameObject.SetActive(false); } chatText.text = _data.type == ChatInfoType.Friend ? _data.content.Replace(ChatCtrl.KILL_IDENTIFY, string.Empty) : _data.content; } } }