Entry.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. Log.Debug("Entry start");
  27. WinPeriod.Init();
  28. MongoHelper.Init();
  29. ProtobufHelper.Init();
  30. Game.AddSingleton<NetServices>();
  31. Game.AddSingleton<Root>();
  32. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  33. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  34. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  35. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  36. }
  37. }
  38. }