A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FullGameFields.cs 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using DataLoader;
  7. using Harmony;
  8. using RobocraftX;
  9. using RobocraftX.Common.Utilities;
  10. using RobocraftX.GUI;
  11. using RobocraftX.Multiplayer;
  12. using RobocraftX.Rendering;
  13. using Svelto.Context;
  14. using Svelto.ECS;
  15. using Svelto.ECS.Schedulers.Unity;
  16. using UnityEngine;
  17. using Unity.Entities;
  18. using Unity.Physics.Systems;
  19. namespace GamecraftModdingAPI.Utility
  20. {
  21. /// <summary>
  22. /// Public access to the private variables in RobocraftX.FullGameCompositionRoot
  23. /// </summary>
  24. public static class FullGameFields
  25. {
  26. public static MultiplayerInitParameters _multiplayerParams
  27. { get
  28. {
  29. return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue();
  30. }
  31. }
  32. public static EnginesRoot _frontEndEnginesRoot
  33. {
  34. get
  35. {
  36. return (EnginesRoot)fgcr?.Field("_frontEndEnginesRoot").GetValue();
  37. }
  38. }
  39. public static EnginesRoot _mainGameEnginesRoot
  40. {
  41. get
  42. {
  43. return (EnginesRoot)fgcr?.Field("_mainGameEnginesRoot").GetValue();
  44. }
  45. }
  46. public static World _physicsWorld
  47. {
  48. get
  49. {
  50. return (World)fgcr?.Field("_physicsWorld").GetValue();
  51. }
  52. }
  53. public static World _renderingWorld
  54. {
  55. get
  56. {
  57. return (World)fgcr?.Field("_renderingWorld").GetValue();
  58. }
  59. }
  60. public static SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler
  61. {
  62. get
  63. {
  64. return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue();
  65. }
  66. }
  67. public static BuildPhysicsWorld _physicsWorldSystem
  68. {
  69. get
  70. {
  71. return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
  72. }
  73. }
  74. public static UnityContext<FullGameCompositionRoot> _contextHolder
  75. {
  76. get
  77. {
  78. return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
  79. }
  80. }
  81. public static GameObject _frontEndGo
  82. {
  83. get
  84. {
  85. return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
  86. }
  87. }
  88. public static GameObject _mainGameGo
  89. {
  90. get
  91. {
  92. return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
  93. }
  94. }
  95. public static PhysicsUtility _physicsUtility
  96. {
  97. get
  98. {
  99. return (PhysicsUtility)fgcr?.Field("_physicsUtility").GetValue();
  100. }
  101. }
  102. /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
  103. {
  104. get
  105. {
  106. return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
  107. }
  108. }*/
  109. public static LoadingScreenImplementer _loadingScreen
  110. {
  111. get
  112. {
  113. return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
  114. }
  115. }
  116. public static IDataDB _dataDb
  117. {
  118. get
  119. {
  120. return (IDataDB)fgcr?.Field("_dataDb").GetValue();
  121. }
  122. }
  123. public static ECSGameObjectResourceManager _eCsGameObjectResourceManager
  124. {
  125. get
  126. {
  127. return (ECSGameObjectResourceManager)fgcr?.Field("_eCsGameObjectResourceManager").GetValue();
  128. }
  129. }
  130. public static bool _isQuitting
  131. {
  132. get
  133. {
  134. return (bool)fgcr?.Field("_isQuitting").GetValue();
  135. }
  136. }
  137. private static Traverse fgcr;
  138. public static void Init(FullGameCompositionRoot instance)
  139. {
  140. fgcr = new Traverse(instance);
  141. }
  142. }
  143. }