【add】主入口初始化
This commit is contained in:
60
Assets/Domain/Main/HotUpdate/MainDomain.cs
Normal file
60
Assets/Domain/Main/HotUpdate/MainDomain.cs
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user