InitClient.cs 654 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.IO;
  3. namespace ET.Client
  4. {
  5. [Callback(CallbackType.InitClient)]
  6. public class InitClient: IFunc<ETTask>
  7. {
  8. public async ETTask Handle()
  9. {
  10. // 加载配置
  11. Game.Scene.AddComponent<ResourcesComponent>();
  12. Game.Scene.AddComponent<GlobalComponent>();
  13. await ResourcesComponent.Instance.LoadBundleAsync("unit.unity3d");
  14. Scene clientScene = SceneFactory.CreateClientScene(1, "Game", Game.Scene);
  15. await Game.EventSystem.PublishAsync(clientScene, new EventType.AppStartInitFinish());
  16. }
  17. }
  18. }