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