【add】主入口初始化

This commit is contained in:
2025-11-03 11:25:01 +08:00
commit 87e659271b
1903 changed files with 220684 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
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());
}
}
}