34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Reflection;
|
|
using Harmony;
|
|
using Svelto.Context;
|
|
using Svelto.ECS;
|
|
using RobocraftX;
|
|
using RobocraftX.Multiplayer;
|
|
using Unity.Entities;
|
|
|
|
using GamecraftModdingAPI.Utility;
|
|
|
|
namespace GamecraftModdingAPI.Commands
|
|
{
|
|
[HarmonyPatch]
|
|
public static class CommandPatch
|
|
{
|
|
public static void Prefix(UnityContext<FullGameCompositionRoot> contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters)
|
|
{
|
|
Logging.Log("Command Line was loaded");
|
|
// When a game is loaded, register the command engines
|
|
// TODO
|
|
}
|
|
|
|
public static MethodBase TargetMethod(HarmonyInstance instance)
|
|
{
|
|
var func = (Action<UnityContext<FullGameCompositionRoot>, EnginesRoot, World, Action, MultiplayerInitParameters>)RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose<UnityContext<FullGameCompositionRoot>>;
|
|
return func.Method;
|
|
}
|
|
}
|
|
}
|