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