lcy
2026-01-28 db03acba6290a09418bcc0a05392a662cc39743e
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
using System;
using System.Collections.Generic;
using UnityEngine;
 
public class GuildNoteNormalCell : MonoBehaviour
{
    [SerializeField] TextEx time;
    [SerializeField] TextEx content;
 
    public void Display(int index, List<GuildNoteData> datas)
    {
        if (datas.IsNullOrEmpty() || index < 0 || index >= datas.Count)
            return;
 
        DateTime currentTime = TimeUtility.GetTime(datas[index].Time);
        time.text = currentTime.ToString("HH:mm");
        content.text = datas[index].Info;
    }
 
    public float GetHeight(string info)
    {
        float height = 0f;
        if (string.IsNullOrEmpty(info))
            return height;
 
        content.text = info;
        height = content.preferredHeight;
        return height;
    }
}