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进入成功"); Camera.main.GetOrAddComponent(); } 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().PushStack(parent: this.transform); StringEventSystem.Global.Register("Rollback", OnRollback); } private void OnRollback() { this.GetSystem().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 { protected override void Init() { //注册示例 //RegisterSystem(new ScoreSystem()); RegisterSystem(new PanelSystem()); } } }