I have this lua script inside "Conversion.lua" file:
local conversion = {}
function conversion.mmToin( value )
return value * 0.0393701
end
return conversion
I need to use the function mmToin in C# code, contained inside the object conversion.
If the function would not be inside the object i would have use the following code:
Script scp = new Script();
scp.DoFile(GlobalConst.PATH_TO_SCRIPT_FOLDER + "Conversion.lua");
double resultFm = scp.Call(scp.Globals["mmToin"], 1).ToObject<double>();
but i can't use the function if i put it inside an object; i've tried:
double resultFm = scp.Call(scp.Globals["conversion.mmToin"], 1).ToObject<double>();
but is not working.
How can i use mmToin function inside C# code?
Thanks.
mmToinin the returned table, not in the global one.DynValue.Tablebut the length is 0DoFileshould leave a table on the stack (the returnvalue) which has a keymmToinwith the value of the function.function is not a function and has no __call metamethod. I suppose because function is not found.