45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public class CollectionRelicUI_Info : MonoBehaviour
|
||
|
|
{
|
||
|
|
public Image[] images; // 0 유물
|
||
|
|
public TextMeshProUGUI[] texts; // 0 이름, 1 갯수, 2 등급, 3 설명, 4 강화 효과, 5 성급 효과, 6 lv
|
||
|
|
public Transform tf_starParent;
|
||
|
|
public GameObject go_star;
|
||
|
|
|
||
|
|
List<GameObject> list_star = new List<GameObject>();
|
||
|
|
|
||
|
|
public void Set(RelicListTableData data)
|
||
|
|
{
|
||
|
|
if (list_star.Count == 0)
|
||
|
|
{
|
||
|
|
var maxstar = table_GlobalValue.Ins.Get_Int("n_RelicMaxStar");
|
||
|
|
for (int i = 0; i < maxstar; i++)
|
||
|
|
list_star.Add(DSUtil.Get_Clone(go_star, tf_starParent));
|
||
|
|
}
|
||
|
|
|
||
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||
|
|
var star = sdata.Get_RelicStar(data.n_RelicID);
|
||
|
|
var lv = sdata.Get_RelicLv(data.n_RelicID);
|
||
|
|
var upgradeData = table_relicupgradecost.Ins.Get_Data(lv);
|
||
|
|
var lvData = table_optionconfig.Ins.Get_Data(data.n_DefaultOptionID);
|
||
|
|
var starData = table_optionconfig.Ins.Get_Data(data.n_StarOptionID);
|
||
|
|
|
||
|
|
for (int i = 0; i < list_star.Count; i++)
|
||
|
|
list_star[i].SetActive(star > i);
|
||
|
|
|
||
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(data.n_RelicID);
|
||
|
|
|
||
|
|
texts[0].text = data.Get_Name();
|
||
|
|
texts[1].text = $"x{sdata.Get_ItemAmount(data.n_RelicID)}";
|
||
|
|
texts[2].text = table_itemlist.Ins.Get_Data(data.n_RelicID).Get_GradeName();
|
||
|
|
texts[3].text = data.Get_Desc();
|
||
|
|
texts[4].text = MyText.Get_StatNameValueText(lvData.e_OptionType, lvData.Get_Value(lv));
|
||
|
|
texts[5].text = MyText.Get_StatNameValueText(starData.e_OptionType, starData.Get_Value(star));
|
||
|
|
texts[6].text = DSUtil.Format(289, lv);
|
||
|
|
}
|
||
|
|
}
|