hch
2026-02-02 04ffe31b6a2b2fbcfecc83abb44a8aa233f2e53f
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.Collections.Generic;
using UnityEngine;
public class SimpleMinggeAttributeCell : MonoBehaviour
{
    [SerializeField] TextEx nameText;
    [SerializeField] TextEx descText;
    AttributeManager manager { get { return AttributeManager.Instance; } }
    public void Display(int index, List<int> skillList, Dictionary<int, int> skillDic)
    {
        if (skillList.IsNullOrEmpty() || skillDic.IsNullOrEmpty() || index < 0 || index >= skillList.Count)
            return;
        int skillId = skillList[index];
        if (!skillList.Contains(skillId))
            return;
        int lv = skillDic[skillId];
        if (!manager.TryGetInfoBySkillID(skillId, lv, out string name, out string desc))
            return;
        nameText.text = name;
        descText.text = desc;
    }
 
    public float GetHeight(string content)
    {
        var height = 0f;
        if (string.IsNullOrEmpty(content))
            return height;
        descText.text = content;
        return descText.preferredHeight + 5;
    }
}