Entry.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.Register();
  30. MongoHelper.RegisterStruct<LSInput>();
  31. Game.AddSingleton<EntitySystemSingleton>();
  32. Game.AddSingleton<LSEntitySystemSington>();
  33. Game.AddSingleton<NetServices>();
  34. Game.AddSingleton<Root>();
  35. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  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. }