hch
2 天以前 89fa96e505af9fe7baf676591222bfdb23b48262
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
using UnityEngine;
 
public class PhantasmPavilionInfoCell : MonoBehaviour
{
    [SerializeField] TextEx txtUnLockInfo;
    [SerializeField] TextEx txtAddInfo;
    [SerializeField] TextEx txtAddNext;
    PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
    public void Display(int index, CellView cellView)
    {
        int id = cellView.info.Value.infoInt1;
        PhantasmPavilionType type = manager.nowType;
        int[] attrIDList = manager.GetAttrIDList(type, id);
        int[] initAttrValueList = manager.GetInitAttrValueList(type, id);
        if (attrIDList.IsNullOrEmpty() || initAttrValueList.IsNullOrEmpty()
        || attrIDList.Length != initAttrValueList.Length || attrIDList.Length <= index)
        {
            txtUnLockInfo.SetActive(false);
            txtAddInfo.SetActive(false);
            txtAddNext.SetActive(false);
            return;
        }
 
        int attrID = attrIDList[index];
        int attrValue = initAttrValueList[index];
        bool isHasAttr = manager.HasInitAttr(type, id);        // 是否有解锁属性
        bool isCanStarAdd = manager.HasStarAddAttr(type, id); // 是否可升星
        bool isStarMax = manager.IsStarMax(type, id);       // 是否已升满
        PhantasmPavilionState state = manager.GetUnLockState(type, id);
        txtUnLockInfo.SetActive(state != PhantasmPavilionState.Activated || (state == PhantasmPavilionState.Activated && isHasAttr && !isCanStarAdd));
        txtAddInfo.SetActive(state == PhantasmPavilionState.Activated && isHasAttr && isCanStarAdd);
        txtAddNext.SetActive(state == PhantasmPavilionState.Activated && isHasAttr && isCanStarAdd && !isStarMax);
        if (isHasAttr)
        {
            txtUnLockInfo.text = PlayerPropertyConfig.GetFullDescription(attrID, attrValue);
        }
 
        if (isCanStarAdd)
        {
            int addValue = manager.GetEndAttrValue(type, id, index);
            txtAddInfo.text = PlayerPropertyConfig.GetFullDescription(attrID, addValue);
        }
 
        if (isCanStarAdd && !isStarMax)
        {
            int[] attrPerStarAddList = manager.GetAttrPerStarAddList(type, id);
            if (attrPerStarAddList.IsNullOrEmpty() || attrIDList.Length != initAttrValueList.Length || attrPerStarAddList.Length <= index)
                return;
            int attrPerStarAdd = attrPerStarAddList[index];
            txtAddNext.text = Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.LightGreen, StringUtility.Contact("+", PlayerPropertyConfig.GetValueDescription(attrID, attrPerStarAdd))));
        }
    }
 
}