| | |
| | | using vnxbqy.UI; |
| | | using System.Collections; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using EnhancedUI.EnhancedScroller; |
| | | public class ChatTrailCell : ScrollerUI |
| | | { |
| | | [SerializeField] Image chatIcon; |
| | | [SerializeField] RichText chatText; |
| | | |
| | | public override void Refresh(CellView cell) |
| | | |
| | | public class ChatTrailCell : ScrollerUI |
| | | { |
| | | [SerializeField] Image chatIcon; |
| | | [SerializeField] RichText chatText; |
| | | |
| | | public override void Refresh(CellView cell) |
| | | { |
| | | ChatData _data = ChatCenter.Instance.GetChatData(ChatManager.Instance.presentChatType, cell.index); |
| | | if (_data == null) |
| | | { |
| | | ChatData _data = ChatCenter.Instance.GetChatData(ChatManager.Instance.presentChatType, cell.index); |
| | | if (_data == null) |
| | | { |
| | | return; |
| | | } |
| | | if (_data.infoList != null) |
| | | { |
| | | chatText.SetExtenalData(_data.infoList); |
| | | } |
| | | chatIcon.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.SetActive(false); |
| | | } |
| | | chatText.text = _data.type == ChatInfoType.Friend ? _data.content.Replace(ChatManager.KILL_IDENTIFY, string.Empty) : _data.content; |
| | | return; |
| | | } |
| | | if (_data.infoList != null) |
| | | { |
| | | chatText.SetExtenalData(_data.infoList); |
| | | } |
| | | chatIcon.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.SetActive(false); |
| | | } |
| | | chatText.text = _data.type == ChatInfoType.Friend ? _data.content.Replace(ChatManager.KILL_IDENTIFY, string.Empty) : _data.content; |
| | | } |
| | | } |
| | | |