Files
plugin-library/Assets/Domain/Main/HotUpdate/MainDomain.cs

63 lines
1.8 KiB
C#
Raw Normal View History

2025-05-23 18:26:47 +08:00
using System.Threading.Tasks;
using Stary.Evo;
using Stary.Evo.UIFarme;
using UnityEngine;
2025-07-02 10:05:26 +08:00
2025-05-23 18:26:47 +08:00
namespace Main
{
2025-07-02 10:05:26 +08:00
public class MainDomain : DomainBase, IController
2025-05-23 18:26:47 +08:00
{
public override void OnEnter(string param)
{
base.OnEnter(param);
Debug.Log("UnityEvo: OnEnter进入成功");
}
public override void OnExit()
{
base.OnExit();
2025-07-02 10:05:26 +08:00
//GetArchitecture().Dispose();
2025-05-23 18:26:47 +08:00
Debug.Log("UnityEvo: OnExit退出成功");
}
2025-07-02 10:05:26 +08:00
public override async Task OnEnterAsync(string param)
2025-05-23 18:26:47 +08:00
{
2025-07-02 10:05:26 +08:00
await base.OnEnterAsync(param);
2025-05-23 18:26:47 +08:00
Debug.Log("UnityEvo: OnEnterAsync进入成功");
2025-07-02 10:05:26 +08:00
await this.GetData<IZoneData>().Load();
2025-05-23 18:26:47 +08:00
this.GetSystem<IZoneSystem>().CreatZone(this.transform);
this.GetSystem<IDigitalHuman>().LoadKKController(this.transform);
}
public override Task OnExitAsync()
{
Debug.Log("UnityEvo: OnEnterAsync退出成功");
return base.OnExitAsync();
}
public void OnDestroy()
{
GetArchitecture().Dispose();
}
2025-07-02 10:05:26 +08:00
2025-05-23 18:26:47 +08:00
public IArchitecture GetArchitecture()
{
return MainArchitecture.Interface;
}
}
2025-07-02 10:05:26 +08:00
2025-05-23 18:26:47 +08:00
public class MainArchitecture : Architecture<MainArchitecture>
{
protected override void Init()
{
2025-07-02 10:05:26 +08:00
//注册示例
//RegisterSystem<IScoreSystem>(new ScoreSystem());
RegisterData<IZoneData>(new ZoneGatherData());
RegisterSystem<IZoneSystem>(new ZoneSystem());
RegisterSystem<IDigitalHuman>(new DigitalHuman());
RegisterSystem<IVideoSystem>(new VideoSystem());
RegisterSystem<IPanelSystem>(new PanelSystem());
2025-05-23 18:26:47 +08:00
}
}
}