Entry.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. namespace ET
  2. {
  3. namespace EventType
  4. {
  5. public struct EntryLoadCfg
  6. {
  7. }
  8. public struct EntryEvent1
  9. {
  10. }
  11. public struct EntryEvent2
  12. {
  13. }
  14. public struct EntryEvent3
  15. {
  16. }
  17. }
  18. public static class Entry
  19. {
  20. public static void Init()
  21. {
  22. }
  23. public static void Start()
  24. {
  25. StartAsync().Coroutine();
  26. }
  27. private static async ETTask StartAsync()
  28. {
  29. Log.Debug("Entry start");
  30. WinPeriod.Init();
  31. MongoHelper.Init();
  32. ProtobufHelper.Init();
  33. Game.AddSingleton<NetServices>();
  34. Game.AddSingleton<Root>();
  35. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryLoadCfg());
  36. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  37. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  38. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  39. }
  40. }
  41. }