Files
weixinFrameWork/Assets/Domain/Main/HotUpdate/MainDomain.cs
2026-06-05 22:12:05 +08:00

62 lines
1.7 KiB
C#

using System.Threading.Tasks;
using Stary.Evo;
using Stary.Evo.UIFarme;
using UnityEngine;
using UnityEngine.Scripting;
namespace Main
{
[Preserve]
public class MainDomain : DomainBase, IController
{
public override void OnEnter(string param)
{
base.OnEnter(param);
Debug.Log("UnityEvo: OnEnter进入成功");
Camera.main.GetOrAddComponent<DeviceXEventHandler>();
}
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>();
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(new YooAssetLoader()));
}
}
}