Entry.cs 1.2 KB

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