63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
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 async Task OnEnterAsync(string param)
|
|
{
|
|
await base.OnEnterAsync(param);
|
|
Debug.Log("UnityEvo: OnEnterAsync进入成功");
|
|
await this.GetData<IZoneData>().Load();
|
|
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();
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
} |