少年修仙传客户端代码仓库
hch
2025-04-03 c154ac0832fe4379a00d3e1cda700e7d2a7383c7
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
using Newtonsoft.Json.Linq;
using vnxbqy.UI;
using UnityEngine;
 
public class PetTotalStatsCell : CellView
{
    [SerializeField] TextEx txtBase;
    [SerializeField] TextEx txtAdd;
    PetModel petmodel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
    public void Display(int index)
    {
        bool isContains = petmodel._DicPetBack.ContainsKey(petmodel.TypePetID);
        if (isContains)
        {
            int rank = petmodel._DicPetBack[petmodel.TypePetID].PetClass;
            int[] AttrType = PetClassCostConfig.GetPetIdAndRank(petmodel.TypePetID, rank).AttrType;
            int[] AttrValue = PetClassCostConfig.GetPetIdAndRank(petmodel.TypePetID, rank).AttrValue;
            rank += 1;
            if (PetClassCostConfig.GetPetIdMaxRank(petmodel.TypePetID) < rank || PetClassCostConfig.GetPetIdMaxRank(petmodel.TypePetID) == -1)
            {
                txtAdd.SetActive(false);
            }
            else
            {
                txtAdd.SetActive(true);
                int[] AttrValue1 = PetClassCostConfig.GetPetIdAndRank(petmodel.TypePetID, rank).AttrValue;
                int type = AttrType[index];
                txtBase.text = StringUtility.Contact(PlayerPropertyConfig.Get(type).Name, " ", PlayerPropertyConfig.GetValueDescription(type, AttrValue[index]));
                txtAdd.text = StringUtility.Contact("+", " ", AttrValue1[index] - AttrValue[index]);
            }
        }
        else
        {
            txtAdd.SetActive(false);
            int[] AttrType = PetClassCostConfig.GetPetIdAndRank(petmodel.TypePetID == 0 ? PetInfoConfig.GetValues()[0].ID : petmodel.TypePetID, 1).AttrType;
            int type = AttrType[index];
            txtBase.text = StringUtility.Contact(PlayerPropertyConfig.Get(type).Name, " ", 0);
        }
    }
}