备份CatanBuilding瘦身独立工程
This commit is contained in:
36
Assets/Scripts/EventCan/EventCanAct.cs
Normal file
36
Assets/Scripts/EventCan/EventCanAct.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user