I try to write a mod for a game. This is totally new territory for me, so I might be on the wrong track here. The game is written in Unity and you are able to add a .script file to your mod. The .script file can contain javascript that is parsed by Jint.
I tried to output a simple string from one of the game DLLs:
var UnityEngine = importNamespace("UnityEngine");
var IceEngine = importNamespace("IceEngine");
var GameMain = importNamespace("GameMain");
var output = GameMain.Game.ModPath;
UnityEngine.Debug.Log("----- Testmod Output Start-----");
UnityEngine.Debug.Log(output);
UnityEngine.Debug.Log("----- Testmod Output End-----");
In the GameMain.dll it says:
public class Game : MonoBehaviour, IUserManagerListener, IAccountMsg, IMsg, IRenderListener
{
private static string modPath = Game.userPath + "/Mods";
// lots of other code...
public static string ModPath
{
get
{
return Game.modPath;
}
}
My understanding is that GameMain.Game.ModPath should give me a string. But instead the output in the log file is this:
----- Testmod Output Start-----
System.Dynamic.ExpandoObject
----- Testmod Output End-----
No matter wehat I try to output, I get a System.Dynamic.ExpandoObject and don't know what to do with it. Maybe someone can give me tips/resources to help. :)