59 lines
1.5 KiB
C#
59 lines
1.5 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public class BuffCard : CardBase
|
||
|
|
{
|
||
|
|
public Image sprite_buff;
|
||
|
|
public TextMeshProUGUI label_time;
|
||
|
|
public GameObject go_on;
|
||
|
|
|
||
|
|
static List<string> list_spritename = new List<string> { "buff_gold", "buff_exp", "buff_item" };
|
||
|
|
int m_Index;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
Act_Repeat_for1sec = Set_Time;
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Set<T>(T _base)
|
||
|
|
{
|
||
|
|
base.Set(_base);
|
||
|
|
|
||
|
|
m_Index = int.Parse(_base.ToString());
|
||
|
|
sprite_buff.sprite = UIAtlasMgr.Ins.Get_Sprite(list_spritename[m_Index]);
|
||
|
|
go_on.SetActive(ServerInfo.Ins.m_ServerData.Buff.isInfinity());
|
||
|
|
Set_Time();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Set_Time()
|
||
|
|
{
|
||
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||
|
|
|
||
|
|
if (sdata.Buff.isInfinity())
|
||
|
|
{
|
||
|
|
Act_Repeat_for1sec = null;
|
||
|
|
label_time.text = "";
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
var time = ServerInfo.Ins.m_ServerData.Buff.Get_RemainTime(m_Index);
|
||
|
|
label_time.text = DSUtil.Get_TimeText_MS(time);
|
||
|
|
if (time > 0)
|
||
|
|
{
|
||
|
|
if (!go_on.activeInHierarchy) go_on.SetActive(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
if (go_on.activeInHierarchy)
|
||
|
|
{
|
||
|
|
label_time.text = "";
|
||
|
|
go_on.SetActive(false);
|
||
|
|
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|