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.

180 lines
3.5KB

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