备份CatanBuilding瘦身独立工程
This commit is contained in:
37
Assets/Scripts/EventGatherCore/EventGatherCoreAct.cs
Normal file
37
Assets/Scripts/EventGatherCore/EventGatherCoreAct.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using GameCore;
|
||||
using asap.core;
|
||||
using System.Threading.Tasks;
|
||||
// using UnityEngine.UI;
|
||||
// using DG.Tweening;
|
||||
// using UnityEngine;
|
||||
|
||||
public class EventGatherCoreAct : AGameAct
|
||||
{
|
||||
public static EventGatherCoreTableContext Ctx;
|
||||
private IDeferredRewardStashService _rewardStashService;
|
||||
private IEventAggregator _eventAggregator;
|
||||
public static readonly string ActAddressable = "EventGatherCoreAct";
|
||||
// private CanvasScaler _canvasScaler;
|
||||
// private readonly float normalScale = 0.75f, actScale = 1.0f, duration = 0.75f;
|
||||
// private readonly Vector2 targetResolution = new Vector2(1080, 2340);
|
||||
// private Vector2 originalResolution;
|
||||
|
||||
public override async Task<bool> StartAsync()
|
||||
{
|
||||
_rewardStashService = GContext.container.Resolve<IDeferredRewardStashService>();
|
||||
_rewardStashService.Reset();
|
||||
_eventAggregator = new EventAggregator();
|
||||
// _canvasScaler = UIManager.Instance.GetComponent<CanvasScaler>();
|
||||
// originalResolution = _canvasScaler.referenceResolution;
|
||||
// DOTween.To(() => _canvasScaler.referenceResolution, v => _canvasScaler.referenceResolution = v, targetResolution, duration).SetEase(Ease.OutQuad);
|
||||
var panelGo = await UIManager.Instance.ShowUILoad(UITypes.EventGatherCorePanel);
|
||||
panelGo.GetComponent<EventGatherCorePanel>().Init(_eventAggregator);
|
||||
return await base.StartAsync();
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
// DOTween.To(() => _canvasScaler.referenceResolution, v => _canvasScaler.referenceResolution = v, originalResolution, duration).SetEase(Ease.OutQuad);
|
||||
UIManager.Instance.DestroyUI(UITypes.EventGatherCorePanel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user