2024-12-15 01:39:39 +00:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class PetCard : CardBase
|
|
|
|
|
{
|
|
|
|
|
public Image[] images; // 0 등급, 1 아이콘
|
|
|
|
|
public TextMeshProUGUI[] texts; // 0 레벨
|
2025-07-14 01:41:08 +00:00
|
|
|
public GameObject[] gos; // 0 출전, 1 획득x
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
PetListTableData m_Data;
|
|
|
|
|
|
|
|
|
|
public override void Set<T>(T _base)
|
|
|
|
|
{
|
|
|
|
|
base.Set(_base);
|
|
|
|
|
m_Data = _base as PetListTableData;
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
|
2025-02-15 05:15:26 +00:00
|
|
|
//images[0].sprite = UIAtlasMgr.Ins.Get_GradeSprite(m_Data.n_PetGrade);
|
2024-12-15 01:39:39 +00:00
|
|
|
images[1].sprite = UIAtlasMgr.Ins.Get_Sprite(m_Data.Get_Icon());
|
|
|
|
|
|
|
|
|
|
texts[0].text = $"Lv.{sdata.Get_PetLv(m_Data.n_PetID)}";
|
|
|
|
|
|
2025-07-14 01:41:08 +00:00
|
|
|
Set_Selected(false);
|
2024-12-15 01:39:39 +00:00
|
|
|
gos[0].SetActive(sdata.Get_EqiupmentEquip(eItem.Pet) == m_Data.n_PetID);
|
2025-07-14 01:41:08 +00:00
|
|
|
gos[1].SetActive(sdata.Get_PetLv(m_Data.n_PetID) < 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Set_Selected(bool active)
|
|
|
|
|
{
|
|
|
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(active ? "slot 2" : "slot 1");
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
2025-07-16 17:30:13 +00:00
|
|
|
public override void Set_CardType(eUICardType _type)
|
|
|
|
|
{
|
|
|
|
|
base.Set_CardType(_type);
|
|
|
|
|
if (_type == eUICardType.NoTouch)
|
|
|
|
|
gos[0].SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
public void OnClick_Pet()
|
|
|
|
|
{
|
2025-02-14 23:33:26 +00:00
|
|
|
if (CardType != eUICardType.NoTouch)
|
|
|
|
|
NewGameUI.Ins.m_PetUI.m_PetUI_Right.SelectPet(this);
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override TableDataBase Get_Data() { return m_Data; }
|
|
|
|
|
}
|