I use SharpLua with MonoDevelop. I created a class on C# side, which should be usable from Lua. That's works fine, I can access all fields from Lua. It's very easy.
public class Test {
public string Name;
}
could be access from Lua with
print(test.Name)
Now, I want to create new fields by Lua. In Lua it should look like
test.abc = "A string"
print(test.abc)
But this didn't work. I get an error in the ObjectTranslator. So I couldn't extend the table from Lua. I didn't want to access this new entries from C#. It should only be possible to create them.
Is there an other way to achieve this? Could I create a class from LuaTable and insert this to Lua?
lua["NewLuaTable"] = new ClassFromLuaTable;
and than use in Lua
NewLuaTable.abc = "A string"
print(NewLuaTable.abc);
But than, how did I get notifications, that something I want to know is changed in the LuaTable (NewLuaTable.Name is changed)?
Thank you for your help.