Here is my setup:
I plan to use JavaScript as the language for modding my game, I currently have it setup to create a javascript context with 3 variables: log, mod and require, require isn't being used yet...
mod is a C# object with the field I am trying to use.
log is also a C# object with functions that redirect to log4net, (mainly info(string format, object[] objs))
Here is the issue, in my javascript file I have:
log.info("Hello from {0}!", [mod.display_name]);
Which results in:
Even though mod's C# object has the field display_name set to "sandbox"
I even checked with the debugger, the C# instance of mod is correct, I debugged the C# function for log.info and noticed that mod.display_name was evaluating to null before being passed through the function. Why is this happening? And how can I fix it?
Here is my setup:
I plan to use JavaScript as the language for modding my game, I currently have it setup to create a javascript context with 3 variables:
log,modandrequire,requireisn't being used yet...modis a C# object with the field I am trying to use.logis also a C# object with functions that redirect to log4net, (mainlyinfo(string format, object[] objs))Here is the issue, in my javascript file I have:
Which results in:
Even though
mod's C# object has the fielddisplay_nameset to"sandbox"I even checked with the debugger, the C# instance of
modis correct, I debugged the C# function forlog.infoand noticed that mod.display_name was evaluating to null before being passed through the function. Why is this happening? And how can I fix it?