Entry.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Timers;
  2. using ICSharpCode.SharpZipLib.Zip;
  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 Start()
  20. {
  21. StartAsync().Coroutine();
  22. }
  23. private static async ETTask StartAsync()
  24. {
  25. MongoRegister.Init();
  26. Game.AddSingleton<NetServices>();
  27. Game.AddSingleton<Root>();
  28. await Game.AddSingleton<ConfigComponent>().LoadAsync();
  29. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent1());
  30. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent2());
  31. await EventSystem.Instance.PublishAsync(Root.Instance.Scene, new EventType.EntryEvent3());
  32. }
  33. }
  34. }