lcy
2025-12-03 b9a6e7e896b451e9c915e782a1789b2afe079cc9
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
using System.Collections;
using UnityEngine;
 
public class ChatSysCell : MonoBehaviour
{
    [SerializeField] ChatBubbleBehaviour m_ChatBubble;
    [SerializeField] RichText chatText;
    ChatManager manager { get { return ChatManager.Instance; } }
    public void Refresh(CellView cell)
    {
        if (!manager.TryGetChatData(manager.nowChatChannel, cell.index, out TalkData data))
            return;
        if (data.InfoList != null)
        {
            chatText.SetExtenalData(data.InfoList);
        }
        m_ChatBubble.DisplaySysBubble(manager.sysBubbleID, manager.sysBubbleColor);
        m_ChatBubble.DisplayContent(data.Content, true);
    }
 
    public float GetHeight(string content, ArrayList list)
    {
        var chatHeight = m_ChatBubble.GetBubbleHeight(content, list);
        if (string.IsNullOrEmpty(content))
        {
            chatHeight = 0;
        }
        //Debug.Log($"GetHeight {chatHeight} chatHeight {chatHeight} GetBubbleHeight {m_ChatBubble.GetBubbleHeight(content, list)} Abs {Mathf.Abs(m_ChatBubble.transform.localPosition.y)}");
        return chatHeight;
    }
}