using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
using System.Linq;
|
|
namespace vnxbqy.UI
|
{
|
|
public class FashionAttrBeh : MonoBehaviour
|
{
|
[SerializeField] Text titleText;
|
[SerializeField] Text starDesText;
|
[SerializeField] List<Text> attrlist = new List<Text>();
|
|
|
FashionDressModel fashionModel { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } }
|
|
public void SetDisplay(int star,int curStar)
|
{
|
int curFashionId = fashionModel.viewFashionDressId;
|
FashionDress fashionDress = null;
|
fashionModel.TryGetFashionDress(curFashionId,out fashionDress);
|
int minStar = 1;
|
int maxStar = fashionDress.maxLevel;
|
|
if(star == curStar
|
&& curStar < maxStar)
|
{
|
titleText.text = Language.Get("FashionDress101",maxStar);
|
}
|
else if(star == curStar
|
&& curStar >= maxStar)
|
{
|
titleText.text = Language.Get("FashionDress105");
|
}
|
else
|
{
|
titleText.text = Language.Get("FashionDress102",star);
|
}
|
|
if (star == curStar)
|
{
|
starDesText.text = Language.Get("FashionDress103",star);
|
}
|
else
|
{
|
starDesText.text = Language.Get("FashionDress104",star);
|
}
|
|
Dictionary<int, int> attrDict = null;
|
fashionModel.TryGetFashionDressProperty(curFashionId,star,out attrDict);
|
if(attrDict != null)
|
{
|
List<int> attrIds = attrDict.Keys.ToList();
|
for (int i = 0; i < attrlist.Count; i++)
|
{
|
var attrText = attrlist[i];
|
if (i < attrIds.Count)
|
{
|
attrText.SetActive(true);
|
int attrId = attrIds[i];
|
int attrValue = attrDict[attrId];
|
attrText.text = PlayerPropertyConfig.GetFullDescription(attrId,attrValue);
|
}
|
else
|
{
|
attrText.SetActive(false);
|
}
|
}
|
}
|
}
|
|
}
|
}
|