You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.3 KiB
93 lines
2.3 KiB
using IVDataFormat;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class CharStatItem : MonoBehaviour
|
|
{
|
|
#region UI
|
|
[Header("UI")]
|
|
[SerializeField]
|
|
private Image imgIcon;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtLevel;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtName;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtValueCur;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtMaxLevel;
|
|
[SerializeField]
|
|
private TextMeshProUGUI txtPrice;
|
|
|
|
[SerializeField]
|
|
private ButtonIV btnPrice;
|
|
#endregion UI
|
|
|
|
|
|
//private int Key = -1;
|
|
|
|
|
|
/*
|
|
public void SetCell(int key)
|
|
{
|
|
dCharStat data = DataHandler.GetCharStat(key);
|
|
if (data == null)
|
|
{
|
|
Key = -1;
|
|
return;
|
|
}
|
|
|
|
Key = key;
|
|
SetData(data);
|
|
}
|
|
|
|
public void UpdateCell()
|
|
{
|
|
if (Key < 0)
|
|
return;
|
|
|
|
dCharStat data = DataHandler.GetCharStat(Key);
|
|
SetData(data);
|
|
}
|
|
|
|
private void SetData(dCharStat data)
|
|
{
|
|
if (data == null)
|
|
return;
|
|
txtLevel.text = FormatString.TextLv(data.level);
|
|
txtName.text = FormatString.StringFormat(LocalizationText.GetText(FormatString.StringFormat("enhancegold{0}", data.id.ToString())));
|
|
txtMaxLevel.text = FormatString.StringFormat("MAX Lv. {0}", data.maxLv.ToString());
|
|
|
|
|
|
if (data.level == data.maxLv)
|
|
{
|
|
txtValueCur.text = DataHandler.GetCharStatValue(Key).ToString();
|
|
}
|
|
else
|
|
{
|
|
txtValueCur.text = FormatString.StringFormat("{0} → {1}", DataHandler.GetCharStatValue(Key).ToString(), DataHandler.GetCharStatValue(Key, -1).ToString());
|
|
}
|
|
|
|
//txtValueCur.text = FormatString.IntString(DataHandler.GetCharStatValue(Key));
|
|
//txtValueNext.text = FormatString.IntString(DataHandler.GetCharStatValue(Key, -1));
|
|
|
|
int iprice = DataHandler.GetCharStatPrice(Key);
|
|
txtPrice.text = FormatString.TextInt(iprice);
|
|
btnPrice.interactable = data.level < data.maxLv && iprice <= DataHandler.Goods.gold;
|
|
}
|
|
|
|
public void BtnLvUp()
|
|
{
|
|
if (Key < 0)
|
|
return;
|
|
|
|
int ilevel = DataHandler.GetCharStatLevel(Key) + 1;
|
|
if (DataHandler.LvUpCharStat(Key, ilevel))
|
|
{
|
|
EnhanceMgr.SLevelUpCharStat(Key);
|
|
}
|
|
}
|
|
*/
|
|
}
|