少年修仙传客户端代码仓库
hch
2025-03-03 28785d6ddf9c08e49527ede9405c7b6c93c6ed32
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
58
59
60
61
using System.Collections.Generic;
using UnityEngine;
 
namespace vnxbqy.UI
{
    public class PhantasmPavilionAttrCell : CellView
    {
        [SerializeField] TextEx txtValue1;
        [SerializeField] TextEx txtValue2;
        [SerializeField] ImageEx imgArrow;
        PhantasmPavilionModel model { get { return ModelCenter.Instance.GetModel<PhantasmPavilionModel>(); } }
 
        public void Display(int index)
        {
            int id = model.selectItemId;
            PhantasmPavilionTab tab = model.selectTab;
            int attrType;
            int attrValue1;
            int attrValue2;
            imgArrow.SetActive(false);
            if (!model.TryGetUnLockAttr(tab, id, out int[] lightAttrTypeArr, out int[] lightAttrValueArr))
                return;
            int unLockState = model.GetUnLockState(tab, id);// 0 - Î´¼¤»î 1 - ¿É¼¤»î 2 - ÒѼ¤»î
 
            if (unLockState == 2)
            {
                if (!model.TryGetInfo(tab, id, out var info))
                    return;
                if (!model.TryGetAttrProp(tab, id, info.Star, out List<int> attrTypeList, out List<int> oldAttrValueList, out List<int> newAttrValueList))
                    return;
                if (!model.TryGetAttrShowType(tab, id, out int showType))
                    return;
                attrType = attrTypeList[index];
                attrValue1 = oldAttrValueList[index];
                attrValue2 = newAttrValueList[index];
                if (showType == 0)
                {
                    txtValue1.text = PlayerPropertyConfig.Get(attrType).Name;
                    txtValue2.text = StringUtility.Contact("+", PlayerPropertyConfig.GetValueDescription(attrType, attrValue2));
                }
                else if (showType == 1)
                {
                    imgArrow.SetActive(true);
                    txtValue1.text = StringUtility.Contact(PlayerPropertyConfig.Get(attrType).Name, ": ", PlayerPropertyConfig.GetValueDescription(attrType, attrValue1));
                    txtValue2.text = PlayerPropertyConfig.GetValueDescription(attrType, attrValue2);
                }
                else
                {
                    return;
                }
            }
            else
            {
                attrType = lightAttrTypeArr[index];
                attrValue1 = lightAttrValueArr[index];
                txtValue1.text = PlayerPropertyConfig.Get(attrType).Name;
                txtValue2.text = StringUtility.Contact("+", PlayerPropertyConfig.GetValueDescription(attrType, attrValue1));
            }
        }
    }
}