I have some background lua codes and I load them on each startup, They work fine, But Is there any way I can convert them to C#?
Here Is my meta table codes:
player = {}
player.__index = player
function player:Add(name)
return setmetatable({name = name}, player)
end
function player:Nick()
return self.name
end
It works fine, Here Is how currently my codes work:
print(ply:Nick())
Currently I search a Player.cs object using a void at my registering lua functions code, I don't have any special void or function on my C# code that has Player object on It, But I want to change all of them to Player object, Also Is there any way I can use the Player.cs voids/strings or anything from lua without registerting them? Player.cs objects are non-static.
I found out that KopiLua and LuaInterface (Latest) Has metatables, All you have to return Is your object, You can not return classes or anyhow add them to LuaInterface, but you can return objects or functions that can do the same. from lua, peoples can use object functions. Functions that has an argument (Even empty) Are used with a :, and others with a dot. Here's the example: