42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
|
|
using System.Collections.Generic;
|
||
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public class BuffADCard : CardBase
|
||
|
|
{
|
||
|
|
public Image[] images; // 0 버프 아이콘
|
||
|
|
public TextMeshProUGUI[] texts; // 0 버프 설명
|
||
|
|
public GameObject[] gos; // 0 버프 적용 중
|
||
|
|
|
||
|
|
static List<string> list_spritename = new List<string> { "skill-image-1", "skill-image-2", "skill-image-3" };
|
||
|
|
int m_Index;
|
||
|
|
|
||
|
|
public override void Set<T>(T _base)
|
||
|
|
{
|
||
|
|
base.Set(_base);
|
||
|
|
m_Index = int.Parse(_base.ToString());
|
||
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(list_spritename[m_Index]);
|
||
|
|
texts[0].text = table_localtext.Ins.Get_Text(m_Index + 370);
|
||
|
|
Set_UI();
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Set_UI()
|
||
|
|
{
|
||
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||
|
|
gos[0].SetActive(sdata.Buff.Get_RemainTime(m_Index) > 0);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void OnClick_AD()
|
||
|
|
{
|
||
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||
|
|
if (sdata.Buff.Get_RemainTime(m_Index) > 0) return;
|
||
|
|
|
||
|
|
ADInfo.Ins.Show_AD(() =>
|
||
|
|
{
|
||
|
|
sdata.Buff.Set_Time(m_Index, 600);
|
||
|
|
Set_UI();
|
||
|
|
MyInfoUI.Ins.Set_Buff();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|