|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- using DataLoader;
- using HarmonyLib;
- using RobocraftX;
- using RobocraftX.Common.Utilities;
- using RobocraftX.GUI;
- using RobocraftX.Multiplayer;
- using RobocraftX.Rendering;
- using Svelto.Context;
- using Svelto.ECS;
- using Svelto.ECS.Schedulers.Unity;
- using UnityEngine;
- using Unity.Entities;
- using Unity.Physics.Systems;
-
- namespace GamecraftModdingAPI.Utility
- {
- /// <summary>
- /// Public access to the private variables in RobocraftX.FullGameCompositionRoot
- /// </summary>
- public static class FullGameFields
- {
- public static FullGameCompositionRoot Instance
- {
- private set;
- get;
- } = null;
-
- public static MultiplayerInitParameters _multiplayerParams
- {
- get
- {
- return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue();
- }
- }
-
- public static EnginesRoot _frontEndEnginesRoot
- {
- get
- {
- return (EnginesRoot)fgcr?.Field("_frontEndEnginesRoot").GetValue();
- }
- }
-
- public static EnginesRoot _mainGameEnginesRoot
- {
- get
- {
- return (EnginesRoot)fgcr?.Field("_mainGameEnginesRoot").GetValue();
- }
- }
-
- public static World _physicsWorld
- {
- get
- {
- return (World)fgcr?.Field("_physicsWorld").GetValue();
- }
- }
-
- public static World _renderingWorld
- {
- get
- {
- return (World)fgcr?.Field("_renderingWorld").GetValue();
- }
- }
-
- public static SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler
- {
- get
- {
- return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue();
- }
- }
-
- public static BuildPhysicsWorld _physicsWorldSystem
- {
- get
- {
- return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
- }
- }
-
- public static UnityContext<FullGameCompositionRoot> _contextHolder
- {
- get
- {
- return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
- }
- }
-
- public static GameObject _frontEndGo
- {
- get
- {
- return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
- }
- }
-
- public static GameObject _mainGameGo
- {
- get
- {
- return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
- }
- }
-
- public static PhysicsUtility _physicsUtility
- {
- get
- {
- return (PhysicsUtility)fgcr?.Field("_physicsUtility").GetValue();
- }
- }
-
- /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
- {
- get
- {
- return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
- }
- }*/
-
- public static LoadingScreenImplementer _loadingScreen
- {
- get
- {
- return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
- }
- }
-
- public static IDataDB _dataDb
- {
- get
- {
- return (IDataDB)fgcr?.Field("_dataDb").GetValue();
- }
- }
-
- public static ECSGameObjectResourceManager _eCsGameObjectResourceManager
- {
- get
- {
- return (ECSGameObjectResourceManager)fgcr?.Field("_eCsGameObjectResourceManager").GetValue();
- }
- }
-
- public static bool _isQuitting
- {
- get
- {
- return (bool)fgcr?.Field("_isQuitting").GetValue();
- }
- }
-
- private static Traverse fgcr;
-
- public static void Init(FullGameCompositionRoot instance)
- {
- fgcr = new Traverse(instance);
- FullGameFields.Instance = instance;
- }
- }
- }
|