Files
ft/Client/Assets/Scripts/EventBoostPack/EventBoostPackEntranceButton.cs
2026-06-29 21:18:33 +08:00

43 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using Activity.HomeEntranceBtn;
using cfg;
using EventBoostPack.Data;
using UnityEngine;
namespace EventBoostPack
{
public class EventBoostPackEntranceButton : AbstractHomeEntranceBtn<EventBoostPackData>
{
protected override Type AssociatedSentryType => typeof(EventBoostPackSentry);
protected override void OnClickBtn()
{
try
{
((EventBoostPackManager)_manager)?.ShowPanel();
}
catch (Exception e)
{
Debug.LogError(e);
}
}
protected override void UpdateTimer(long _ = 0L)
{
gameObject.SetActive(IsActivityActive());
TimeSpan timer = _cachedData?.RemainingTime ?? TimeSpan.Zero;
textTimer.text = ConvertTools.ConvertTime2(timer);
}
protected override string GetIconName()
{
return Data?.PackConfig?.Icon;
}
protected override List<string> GetResourceNames()
{
var config = Data?.PackConfig;
if (config == null) return null;
return new List<string> { config.Panel, config.Icon };
}
}
}