You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.6 KiB
42 lines
1.6 KiB
3 years ago
|
namespace ET
|
||
|
{
|
||
|
public class AppStart_Init: AEvent<EventType.AppStart>
|
||
|
{
|
||
|
protected override void Run(EventType.AppStart args)
|
||
|
{
|
||
|
RunAsync(args).Coroutine();
|
||
|
}
|
||
|
|
||
|
private async ETTask RunAsync(EventType.AppStart args)
|
||
|
{
|
||
|
Game.Scene.AddComponent<TimerComponent>();
|
||
|
Game.Scene.AddComponent<CoroutineLockComponent>();
|
||
|
|
||
|
// 加载配置
|
||
|
Game.Scene.AddComponent<ConfigComponent>();
|
||
|
await ConfigComponent.Instance.LoadAsync();
|
||
|
|
||
|
Game.Scene.AddComponent<OpcodeTypeComponent>();
|
||
|
Game.Scene.AddComponent<MessageDispatcherComponent>();
|
||
|
Game.Scene.AddComponent<SessionStreamDispatcher>();
|
||
|
Game.Scene.AddComponent<NetThreadComponent>();
|
||
|
Game.Scene.AddComponent<ZoneSceneManagerComponent>();
|
||
|
Game.Scene.AddComponent<NumericWatcherComponent>();
|
||
|
Game.Scene.AddComponent<AIDispatcherComponent>();
|
||
|
Game.Scene.AddComponent<RobotCaseDispatcherComponent>();
|
||
|
Game.Scene.AddComponent<RobotCaseComponent>();
|
||
|
|
||
|
var processScenes = StartSceneConfigCategory.Instance.GetByProcess(Game.Options.Process);
|
||
|
foreach (StartSceneConfig startConfig in processScenes)
|
||
|
{
|
||
|
await RobotSceneFactory.Create(Game.Scene, startConfig.Id, startConfig.InstanceId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
|
||
|
}
|
||
|
|
||
|
if (Game.Options.Console == 1)
|
||
|
{
|
||
|
Game.Scene.AddComponent<ConsoleComponent>();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|