62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PCInfoUI_CollectionCard : CardBase
|
|
{
|
|
public CanvasGroup m_canvasGroup;
|
|
public PCInfoUI_CollectionCard_Scroll m_Scroll;
|
|
public TextMeshProUGUI[] texts; // 0 이름, 1 능력치, 2 수집효과
|
|
public Image[] images; // 0 수집효과
|
|
public GameObject[] gos; // 0 잠금
|
|
|
|
public override void Set<T>(T _base)
|
|
{
|
|
base.Set(_base);
|
|
var data = _base as PCCostumeCollectionListTableData;
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
texts[0].text = table_localtext.Ins.Get_Text(data.n_CollectionName);
|
|
texts[1].text = MyText.Get_StatNameValueText(data.e_Stat, data.n_StatValue);
|
|
m_Scroll.Set(data.list_CostumeID);
|
|
|
|
var obtaincount = Get_ObtainCostumeCount(data);
|
|
if (obtaincount == data.list_CostumeID.Count)
|
|
{ // 모두 가지고 있음
|
|
m_canvasGroup.alpha = 1f;
|
|
gos[0].SetActive(false);
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite("button unlock");
|
|
texts[2].color = new Color32(73, 41, 23, 255);
|
|
}
|
|
else if (obtaincount > 0)
|
|
{ // 일부 가지고 있음
|
|
m_canvasGroup.alpha = 1f;
|
|
gos[0].SetActive(true);
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite("button lock");
|
|
texts[2].color = Color.white;
|
|
}
|
|
else
|
|
{ // 아무것도 없음
|
|
m_canvasGroup.alpha = 0.5f;
|
|
gos[0].SetActive(true);
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite("button lock");
|
|
texts[2].color = Color.white;
|
|
}
|
|
}
|
|
|
|
int Get_ObtainCostumeCount(PCCostumeCollectionListTableData data)
|
|
{
|
|
int count = 0;
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
for (int i = 0; i < data.list_CostumeID.Count; i++)
|
|
{
|
|
if (sdata.IsObtainItem(data.list_CostumeID[i]))
|
|
++count;
|
|
}
|
|
return count;
|
|
}
|
|
|
|
public void SelectCard_MyCostume()
|
|
{
|
|
m_Scroll.SelectCard_MyCostume(ServerInfo.Ins.m_ServerData.Get_EqiupmentEquip(eItem.PCCostume));
|
|
}
|
|
} |