Files
back_cantanBuilding/Assets/Scripts/EventCan/EventCanAct.cs
2026-05-26 16:15:54 +08:00

37 lines
1.4 KiB
C#

using asap.core;
using UnityEngine;
using System.Threading.Tasks;
using GameCore;
using UnityEngine.AddressableAssets;
public class EventCanAct : AGameAct
{
public static IEventAggregator EventAggregator = new EventAggregator();
public static EventCanParamsCtrl ParamsCtrl;
public static EventCanSystem CanSystem;
// public static EventCanChainPackData ChainPackData;
public static string ActAddressable = "EventCanAct";
public override async Task<bool> StartAsync()
{
Debug.Log("Enter EventCanAct.");
ParamsCtrl = (EventCanParamsCtrl)await Addressables.LoadAssetAsync<object>("EventCanParamsCtrl").Task;
GContext.container.Resolve<IDeferredRewardStashService>().Reset();
CanSystem = new EventCanSystem();
await UIManager.Instance.ShowUILoad(UITypes.EventCanPanel);
if (!GContext.container.Resolve<IFootPrintService>().HasFootPrint(EFootPrint.IsEventCanGuidePoped))
{
await UIManager.Instance.ShowUINotLoading(UITypes.EventCanInfoPanel);
GContext.container.Resolve<IFootPrintService>().UpdateFootPrint(EFootPrint.IsEventCanGuidePoped);
}
return await base.StartAsync();
}
protected override void OnDestroy()
{
UIManager.Instance.DestroyUI(UITypes.EventCanPanel);
// GContext.container.Resolve<IDeferredRewardStashService>().Flush();
Debug.Log("Exit EventCanAct.");
}
}