Entry.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 Init()
  18. {
  19. }
  20. public static void Start()
  21. {
  22. StartAsync().Coroutine();
  23. }
  24. private static async ETTask StartAsync()
  25. {
  26. WinPeriod.Init();
  27. MongoHelper.Init();
  28. ProtobufHelper.Init();
  29. Game.AddSingleton<NetServices>();
  30. Game.AddSingleton<Root>();
  31. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  32. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  33. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  34. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  35. }
  36. }
  37. }