Entry.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.RegisterStruct<LSInput>();
  30. MongoHelper.Register();
  31. World.Instance.AddSingleton<OpcodeType>();
  32. World.Instance.AddSingleton<IdValueGenerater>();
  33. World.Instance.AddSingleton<ObjectPool>();
  34. World.Instance.AddSingleton<ActorMessageQueue>();
  35. World.Instance.AddSingleton<EntitySystemSingleton>();
  36. World.Instance.AddSingleton<LSEntitySystemSingleton>();
  37. World.Instance.AddSingleton<MessageDispatcherComponent>();
  38. World.Instance.AddSingleton<NumericWatcherComponent>();
  39. World.Instance.AddSingleton<AIDispatcherComponent>();
  40. World.Instance.AddSingleton<ActorMessageDispatcherComponent>();
  41. World.Instance.AddSingleton<FiberManager>();
  42. World.Instance.AddSingleton<NetServices>();
  43. World.Instance.AddSingleton<NavmeshComponent>();
  44. MainThreadScheduler mainThreadScheduler = World.Instance.AddSingleton<MainThreadScheduler>();
  45. await World.Instance.AddSingleton<ConfigComponent>().LoadAsync();
  46. int fiberId = FiberManager.Instance.Create(ConstFiberId.Main, 0, SceneType.Main, "");
  47. mainThreadScheduler.Add(fiberId);
  48. }
  49. }
  50. }