yyl
2025-06-09 b9751b2f076ee050fe5b685e91ae4fc4469b1015
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
 
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)
        {
            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;
    }
}