Entry.cs 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. Game.AddSingleton<NetServices>();
  26. Game.AddSingleton<Root>();
  27. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  28. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  29. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  30. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  31. }
  32. }
  33. }