Entry.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace ET
  2. {
  3. namespace EventType
  4. {
  5. public struct EntryLoadCfg { }
  6. public struct EntryEvent1 { }
  7. public struct EntryEvent2 { }
  8. public struct EntryEvent3 { }
  9. }
  10. public static class Entry
  11. {
  12. public static void Init()
  13. {
  14. }
  15. public static void Start()
  16. {
  17. StartAsync().Coroutine();
  18. }
  19. private static async ETTask StartAsync()
  20. {
  21. Log.Debug("Entry start");
  22. WinPeriod.Init();
  23. MongoHelper.Init();
  24. ProtobufHelper.Init();
  25. Game.AddSingleton<NetServices>();
  26. Game.AddSingleton<Root>();
  27. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryLoadCfg());
  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. }