Entry.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. namespace ET
  2. {
  3. namespace EventType
  4. {
  5. public struct EntryEvent1
  6. {
  7. }
  8. public struct EntryEvent2
  9. {
  10. }
  11. public struct EntryEvent3
  12. {
  13. }
  14. }
  15. public static class Entry
  16. {
  17. public static void Start()
  18. {
  19. StartAsync().Coroutine();
  20. }
  21. private static async ETTask StartAsync()
  22. {
  23. WinPeriod.Init();
  24. MongoRegister.Init();
  25. ProtobufRegister.Init();
  26. Game.AddSingleton<NetServices>();
  27. Game.AddSingleton<Root>();
  28. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  29. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  30. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  31. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  32. }
  33. }
  34. }