44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Activity.HomeEntranceBtn;
|
|
using asap.core;
|
|
using EventSmash.Manager;
|
|
using game;
|
|
using GameCore;
|
|
using UnityEngine;
|
|
|
|
namespace EventSmash
|
|
{
|
|
public class EventSmashEntranceButton : AbstractHomeEntranceBtn<EventSmashData>
|
|
{
|
|
protected override Type AssociatedSentryType => typeof(EventSmashSentry);
|
|
|
|
protected override void OnClickBtn()
|
|
{
|
|
try
|
|
{
|
|
if (Data?.MainConfig != null)
|
|
GContext.Publish(new UnloadActToNextAct(EventSmashAct.ActAddress));
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Debug.LogError(e);
|
|
}
|
|
}
|
|
|
|
protected override string GetIconName()
|
|
{
|
|
return Data?.MainConfig?.Icon ?? "";
|
|
}
|
|
|
|
protected override List<string> GetResourceNames()
|
|
{
|
|
var mainConfig = Data?.MainConfig;
|
|
if (mainConfig == null) return new List<string>();
|
|
var names = new List<string> { mainConfig.UIPanel, mainConfig.InfoPanel, mainConfig.BattlePassPanel, mainConfig.PackPanel, mainConfig.Icon };
|
|
names.AddRange(mainConfig.CollectionIcon);
|
|
return names;
|
|
}
|
|
}
|
|
}
|