60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using System.Threading.Tasks;
|
|
using Stary.Evo;
|
|
using Stary.Evo.UIFarme;
|
|
using UnityEngine;
|
|
|
|
namespace Main
|
|
{
|
|
public class MainDomain : DomainBase, IController
|
|
{
|
|
public override void OnEnter(string param)
|
|
{
|
|
base.OnEnter(param);
|
|
Debug.Log("UnityEvo: OnEnter进入成功");
|
|
}
|
|
|
|
public override void OnExit()
|
|
{
|
|
base.OnExit();
|
|
GetArchitecture().OnDispose();
|
|
Debug.Log("UnityEvo: OnExit退出成功");
|
|
}
|
|
|
|
public override async Task OnEnterAsync(string param)
|
|
{
|
|
await base.OnEnterAsync(param);
|
|
Debug.Log("UnityEvo: OnEnterAsync进入成功");
|
|
await this.GetSystem<IPanelSystem>().PushStack<DomainPanel>(parent: this.transform);
|
|
Camera.main.GetOrAddComponent<DeviceXEventHandler>();
|
|
StringEventSystem.Global.Register("Rollback", OnRollback);
|
|
}
|
|
|
|
private void OnRollback()
|
|
{
|
|
this.GetSystem<IPanelSystem>().PopStack();
|
|
HybridClREntrance.Global.CloseDomain();
|
|
}
|
|
|
|
public override Task OnExitAsync()
|
|
{
|
|
Debug.Log("UnityEvo: OnEnterAsync退出成功");
|
|
return base.OnExitAsync();
|
|
}
|
|
|
|
public IArchitecture GetArchitecture()
|
|
{
|
|
return MainArchitecture.Interface;
|
|
}
|
|
}
|
|
|
|
|
|
public class MainArchitecture : Architecture<MainArchitecture>
|
|
{
|
|
protected override void Init()
|
|
{
|
|
//注册示例
|
|
//RegisterSystem<IScoreSystem>(new ScoreSystem());
|
|
RegisterSystem<IPanelSystem>(new PanelSystem());
|
|
}
|
|
}
|
|
} |