using System; using System.Collections.Generic; using Activity.HomeEntranceBtn; using Event1v1Battle.Data; using UnityEngine; namespace Event1v1Battle { public class Event1v1BattleSlapEntranceButton : AbstractHomeEntranceBtn { [SerializeField] private GameObject battle; protected override void Awake() { if (!battle) battle = this.gameObject.FindChildGameObject("battle"); base.Awake(); } protected override Type AssociatedSentryType => typeof(Event1v1BattleSlapSentry); protected override void UpdateTimer(long _ = 0L) { base.UpdateTimer(_); if (battle) battle.SetActive(Data?.IsOnGoing??false); } protected override async void OnClickBtn() { try { await ((Event1v1BattleSlapManager)_manager).ShowSlapPanel(); } catch (Exception e) { Debug.LogError(e); } } protected override string GetIconName() { return Data?.InitConfig?.Icon; } protected override List GetResourceNames() { var config = Data?.InitConfig; if (config == null) return null; return new List { config.UIPanel,config.StageReviewPanel,config.LoadingPanel,config.InfoPanel,config.EventPreviewPanel,config.RewardPanel,config.TvPopUpPanel, config.Icon }; } } }