32 lines
960 B
C#
32 lines
960 B
C#
using Fantasy;
|
||
using Fantasy.Async;
|
||
using Fantasy.Event;
|
||
|
||
|
||
public class OnCreateScene_InitEvent : AsyncEventSystem<OnCreateScene>
|
||
{
|
||
protected override async FTask Handler(OnCreateScene self)
|
||
{
|
||
var scene = self.Scene;
|
||
switch (scene.SceneType)
|
||
{
|
||
case SceneType.Authentication:
|
||
scene.AddComponent<AuthenticationComponent>();
|
||
scene.AddComponent<AuthenticationJWTComponent>();
|
||
Log.Debug("初始化鉴权服务器组件");
|
||
break;
|
||
case SceneType.Gate:
|
||
scene.AddComponent<GateComponent>();
|
||
scene.AddComponent<GateJWTComponent>();
|
||
Log.Debug("初始网关(Gate)服务器组件");
|
||
break;
|
||
|
||
case SceneType.Chat:
|
||
scene.AddComponent<ChatComponent>();
|
||
break;
|
||
}
|
||
|
||
await FTask.CompletedTask;
|
||
|
||
}
|
||
} |