Entry.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. [MemoryPackable]
  18. public partial class BB
  19. {
  20. public int a;
  21. }
  22. [MemoryPackable]
  23. public partial class AA
  24. {
  25. public int a;
  26. }
  27. public static class Entry
  28. {
  29. public static void Init()
  30. {
  31. }
  32. public static void Start()
  33. {
  34. StartAsync().Coroutine();
  35. }
  36. private static async ETTask StartAsync()
  37. {
  38. WinPeriod.Init();
  39. MongoHelper.Init();
  40. ProtobufHelper.Init();
  41. MemoryPackHelper.Init();
  42. Game.AddSingleton<NetServices>();
  43. Game.AddSingleton<Root>();
  44. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  45. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  46. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  47. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  48. }
  49. }
  50. }