64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PCAbilityCard : CardBase
|
|
{
|
|
public Image[] images; // 0 아이콘
|
|
public TextMeshProUGUI[] texts; // 0 레벨
|
|
public GameObject[] gos_arrow; // 0 오른쪽 한칸, 1 오른쪽 두칸, 2 밑으로 한칸, 3 위로 한칸
|
|
|
|
AbilityConfigTableData m_Data;
|
|
|
|
public override void Set<T>(T _base)
|
|
{
|
|
base.Set(_base);
|
|
m_Data = _base as AbilityConfigTableData;
|
|
Set_UI();
|
|
|
|
var nextability = table_abilityconfig.Ins.Get_Data_orNull(m_Data.n_NextAbility);
|
|
if (!DSUtil.CheckNull(nextability))
|
|
{
|
|
if (nextability.n_AbilityOrder > m_Data.n_AbilityOrder) // 아래로
|
|
gos_arrow[2].SetActive(true);
|
|
else if (nextability.n_AbilityOrder < m_Data.n_AbilityOrder) // 위로
|
|
gos_arrow[3].SetActive(true);
|
|
|
|
if (nextability.n_AbilityStep - m_Data.n_AbilityStep >= 2)
|
|
gos_arrow[1].SetActive(true);
|
|
else if (nextability.n_AbilityStep - m_Data.n_AbilityStep == 1)
|
|
gos_arrow[0].SetActive(true);
|
|
}
|
|
}
|
|
|
|
public override void Set_UI()
|
|
{
|
|
if (DSUtil.CheckNull(m_Data)) return;
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
images[0].enabled = true;
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(m_Data.n_AbilityID);
|
|
texts[0].text = $"Lv.{sdata.Get_AbilityLv(m_Data.n_AbilityID)}";
|
|
}
|
|
|
|
public override void Set_CardType(eUICardType _type)
|
|
{
|
|
base.Set_CardType(_type);
|
|
for (int i = 0; i < images.Length; i++)
|
|
images[i].enabled = false;
|
|
for (int i = 0; i < texts.Length; i++)
|
|
texts[i].text = "";
|
|
DSUtil.InActivateGameObjects(gos_arrow);
|
|
}
|
|
|
|
public override void Do_SomeThing()
|
|
{
|
|
m_Data = null;
|
|
}
|
|
|
|
public void OnClick_Ability()
|
|
{
|
|
if (CardType == eUICardType.UI)
|
|
PCAbilityUI.Ins.m_PCAbilityLvUpUI.Set(m_Data);
|
|
}
|
|
} |