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