Browse Source

Add new command to CLI (PoC)

tags/v0.0.0a
NGnius 5 years ago
parent
commit
cdfe9a42bd
2 changed files with 18 additions and 4 deletions
  1. +6
    -0
      TestMod/TestMod.csproj
  2. +12
    -4
      TestMod/TestPlugin.cs

+ 6
- 0
TestMod/TestMod.csproj View File

@@ -5,6 +5,9 @@
</PropertyGroup>

<ItemGroup>
<Reference Include="CommandLine">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\CommandLine.dll</HintPath>
</Reference>
<Reference Include="IllusionPlugin">
<HintPath>..\..\..\IPA\IPA\bin\Debug\IPA\Data\Managed\IllusionPlugin.dll</HintPath>
</Reference>
@@ -14,6 +17,9 @@
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="uREPL">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\RobocraftX_Data\Managed\uREPL.dll</HintPath>
</Reference>
</ItemGroup>

</Project>

+ 12
- 4
TestMod/TestPlugin.cs View File

@@ -1,6 +1,7 @@
using System;
using IllusionPlugin;
using UnityEngine;
using uREPL;

namespace TestMod
{
@@ -10,7 +11,7 @@ namespace TestMod

public string Name { get; } = "TestPlugin";

public string Version { get; } = "2";
public string Version { get; } = "v0.0.0a";

public void OnApplicationQuit()
{
@@ -19,8 +20,9 @@ namespace TestMod

public void OnApplicationStart()
{
//throw new NotImplementedException();
UnityEngine.Debug.Log("Hello World!");
Debug.Log("Hello World!");
RuntimeCommands.Register<object>("Log", LogCommand,"Write a message to Player.log (Runtime version)");
Debug.Log("TestPlugin startup complete");
}

public void OnFixedUpdate()
@@ -46,7 +48,13 @@ namespace TestMod
public void OnUpdate()
{
//throw new NotImplementedException();
UnityEngine.Debug.Log("Baby's first mod injection");
//UnityEngine.Debug.Log("Baby's first mod injection");
}

/* Log command method. This called by uREPL when the Log <object> command is called from RCX */
private void LogCommand(object msg)
{
Debug.Log(msg);
}
}
}