2025-03-05 05:32:40 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class IngameBuffDebuffCard : CardBase
|
|
|
|
|
{
|
|
|
|
|
public Image i_icon, i_cooltime;
|
|
|
|
|
|
|
|
|
|
IngameBuffDebuffData m_Data;
|
2025-03-05 06:40:37 +00:00
|
|
|
float f_MaxTime;
|
2025-03-05 05:32:40 +00:00
|
|
|
|
|
|
|
|
public override void Set<T>(T _base)
|
|
|
|
|
{
|
|
|
|
|
base.Set(_base);
|
|
|
|
|
m_Data = _base as IngameBuffDebuffData;
|
|
|
|
|
i_icon.sprite = UIAtlasMgr.Ins.Get_Sprite(m_Data.s_Icon);
|
|
|
|
|
i_cooltime.fillAmount = 0f;
|
2025-03-05 06:40:37 +00:00
|
|
|
f_MaxTime = m_Data.f_Time;
|
2025-03-05 05:32:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
2025-03-05 06:40:37 +00:00
|
|
|
m_Data.f_Time -= Time.deltaTime;
|
|
|
|
|
i_cooltime.fillAmount = m_Data.f_Time / f_MaxTime;
|
|
|
|
|
if (m_Data.f_Time <= 0f)
|
|
|
|
|
gameObject.SetActive(false);
|
2025-03-05 05:32:40 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class IngameBuffDebuffData
|
|
|
|
|
{
|
|
|
|
|
public string s_Icon;
|
|
|
|
|
public float f_Time;
|
|
|
|
|
}
|