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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using UnityEngine;
using UnityEngine.UI;
using System;
 
 
//命格自动的各个选项内容,统一用一个按类型区分
public class MinggeAutoSetCell : CellView
{
    [SerializeField] Text contentText;
    [SerializeField] Image selectImg;
    [SerializeField] Button selectBtn;
 
    //type 滚动条用途类型
    //index 根据类型自定义
    public void Display(int type, int index, MinggeAutoSet autoSet, Action<int> onSelect)
    {
        if (type == 1)
        {
            //品质
            string qualityName = Language.Get("L1039", MGGuayuQualityConfig.Get(index).ColorName);
            contentText.text = Language.Get("Mingge30", UIHelper.AppendColor(index, qualityName, true, 2));
            selectImg.SetActive(autoSet.quanlity == index);
        }
        else if (type == 2)
        {
            //战斗属性
            contentText.text = index == 0 ? Language.Get("Mingge33") : PlayerPropertyConfig.Get(index).Name;
            selectImg.SetActive(autoSet.fightAttrID == index);
        }
        else if (type == 3)
        {
            //抗性属性
            contentText.text = index == 0 ? Language.Get("Mingge33") : PlayerPropertyConfig.Get(index).Name;
            selectImg.SetActive(autoSet.deFightAttrID == index);
        }
        else if (type == 4)
        {
            //命格技能
            contentText.text = index == 0 ? Language.Get("Mingge33") : Language.Get($"MinggeSkillType_{index}");
            selectImg.SetActive(autoSet.skillID == index);
        }
        else if (type == 5)
        {
            //消耗数量
            contentText.text = index.ToString();
            selectImg.SetActive(MinggeManager.Instance.autoCostCount == index);
        }
 
        selectBtn.AddListener(() =>
        {
            onSelect?.Invoke(index);
        });
    }
 
 
 
}