Entry.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. namespace ET
  2. {
  3. namespace EventType
  4. {
  5. public struct EntryEvent1
  6. {
  7. }
  8. public struct EntryEvent2
  9. {
  10. }
  11. public struct EntryEvent3
  12. {
  13. }
  14. }
  15. public static class Entry
  16. {
  17. public static void Init()
  18. {
  19. }
  20. public static void Start()
  21. {
  22. StartAsync().Coroutine();
  23. }
  24. private static async ETTask StartAsync()
  25. {
  26. WinPeriod.Init();
  27. MongoHelper.RegisterStruct<LSInput>();
  28. MongoHelper.Register();
  29. World.Instance.AddSingleton<TimeInfo>();
  30. World.Instance.AddSingleton<IdGenerater>();
  31. World.Instance.AddSingleton<OpcodeType>();
  32. World.Instance.AddSingleton<ObjectPool>();
  33. World.Instance.AddSingleton<MessageQueue>();
  34. World.Instance.AddSingleton<NetServices>();
  35. World.Instance.AddSingleton<NavmeshComponent>();
  36. World.Instance.AddSingleton<FiberManager>();
  37. World.Instance.AddSingleton<LogMsg>();
  38. // 创建需要reload的code singleton
  39. CodeTypes.Instance.CreateCodeSingleton();
  40. await FiberManager.Instance.Create(SchedulerType.Main, ConstFiberId.Main, 0, SceneType.Main, "");
  41. }
  42. }
  43. }