using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class FairyAffinityCoolTime : MonoBehaviour
|
{
|
[SerializeField] Text m_Time;
|
[SerializeField] Image m_bg;
|
|
private void OnEnable()
|
{
|
GlobalTimeEvent.Instance.secondEvent += RefreshSecond;
|
RefreshSecond();
|
}
|
|
private void OnDisable()
|
{
|
GlobalTimeEvent.Instance.secondEvent -= RefreshSecond;
|
}
|
|
private void RefreshSecond()
|
{
|
m_bg.SetActive(true);
|
m_Time.SetActive(true);
|
int seconds = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.default44);
|
if (seconds > 0)
|
{
|
if (seconds < 86400)
|
{
|
m_Time.text = StringUtility.Contact("<color=#8DDC11FF>", TimeUtility.SecondsToHMS(seconds), "</color>");
|
}
|
else
|
{
|
m_bg.SetActive(false);
|
m_Time.SetActive(false);
|
}
|
}
|
else
|
{
|
m_Time.text = UIHelper.AppendColor(TextColType.Red, Language.Get("XMZZ110"));
|
}
|
}
|
}
|
}
|