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