Files
plugin-library/Assets/Main/Script/Runtime/HotUpdate/MainDomain.cs

61 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;
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().Dispose();
Debug.Log("UnityEvo: OnExit退出成功");
}
public override Task OnEnterAsync(string param)
{
Debug.Log("UnityEvo: OnEnterAsync进入成功");
this.GetSystem<IZoneSystem>().CreatZone(this.transform);
this.GetSystem<IDigitalHuman>().LoadKKController(this.transform);
return base.OnEnterAsync(param);
}
public override Task OnExitAsync()
{
Debug.Log("UnityEvo: OnEnterAsync退出成功");
return base.OnExitAsync();
}
public void OnDestroy()
{
GetArchitecture().Dispose();
}
public IArchitecture GetArchitecture()
{
return MainArchitecture.Interface;
}
}
public class MainArchitecture : Architecture<MainArchitecture>
{
protected override void Init()
{
//注册示例
//RegisterSystem<IScoreSystem>(new ScoreSystem());
RegisterData<IZoneData>(new ZoneGatherData());
RegisterSystem<IZoneSystem>(new ZoneSystem());
RegisterSystem<IDigitalHuman>(new DigitalHuman());
RegisterSystem<IVideoSystem>(new VideoSystem());
RegisterSystem<IPanelSystem>(new PanelSystem());
}
}
}