65 lines
2.0 KiB
C#
65 lines
2.0 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PCInfoUI_CostumeCard : CardBase
|
|
{
|
|
public Image[] images; // 0 bg, 1 face, 2 status
|
|
public TextMeshProUGUI[] texts; // 0 status (장착중 보유중 미보유)
|
|
public GameObject[] gos; // 0 미보유
|
|
|
|
static Color32 textColor = new Color32(45, 48, 98, 255);
|
|
CostumeListTableData m_Data;
|
|
|
|
public override void Set<T>(T _base)
|
|
{
|
|
base.Set(_base);
|
|
m_Data = _base as CostumeListTableData;
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
Set_Selected(false);
|
|
images[1].sprite = UIAtlasMgr.Ins.Get_Sprite(Get_IntData());
|
|
if (sdata.IsEquip(eItem.PCCostume, Get_IntData()))
|
|
{ // 장착중
|
|
texts[0].text = table_localtext.Ins.Get_Text(207);
|
|
texts[0].color = textColor;
|
|
images[2].sprite = UIAtlasMgr.Ins.Get_Sprite("label 5");
|
|
gos[0].SetActive(false);
|
|
}
|
|
else if (sdata.IsObtainItem(Get_IntData()))
|
|
{ // 보유중
|
|
texts[0].text = table_localtext.Ins.Get_Text(402);
|
|
texts[0].color = textColor;
|
|
images[2].sprite = UIAtlasMgr.Ins.Get_Sprite("label 3");
|
|
gos[0].SetActive(false);
|
|
}
|
|
else
|
|
{ // 미보유
|
|
texts[0].text = table_localtext.Ins.Get_Text(208);
|
|
texts[0].color = Color.white;
|
|
images[2].sprite = UIAtlasMgr.Ins.Get_Sprite("label 3"); // 새로운 이미지 필요
|
|
gos[0].SetActive(true);
|
|
}
|
|
}
|
|
|
|
public override void Set_Selected(bool active)
|
|
{
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(active ? "slot 2" : "slot 1");
|
|
}
|
|
|
|
public override int Get_IntData() { return m_Data.n_CostumeID; }
|
|
|
|
public void SelectCard_MyCostume()
|
|
{
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
if (sdata.IsEquip(eItem.PCCostume, Get_IntData()))
|
|
{ // 장착중
|
|
OnClick_Costume();
|
|
}
|
|
}
|
|
|
|
public void OnClick_Costume()
|
|
{
|
|
PCInfoUI.Ins.m_PCInfoUI_Center.Set(this);
|
|
}
|
|
} |