You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you can only add fields to a Lua defined type by defining it on the constructor. If you attempt to access a nonexistent field after construction, it will throw an exception because the field is not found. For C# defined types, this makes sense since the field doesn't exist. But it would be beneficial to be able to add fields dynamically to a Lua defined types.
Note that this will NOT change the C# exposed type. This will only affect field access within Lua. To have a field visible to C# code, it MUST be defined on the constructor so it appears in the generated type signature.
classTypefunctionType:__ctor()
self.newField=123end-- Currently you have to define the field using a default or a type.-- Type.newField = intlocalinst=Type()
assert(inst.newField==123)
The text was updated successfully, but these errors were encountered:
Currently, you can only add fields to a Lua defined type by defining it on the constructor. If you attempt to access a nonexistent field after construction, it will throw an exception because the field is not found. For C# defined types, this makes sense since the field doesn't exist. But it would be beneficial to be able to add fields dynamically to a Lua defined types.
Note that this will NOT change the C# exposed type. This will only affect field access within Lua. To have a field visible to C# code, it MUST be defined on the constructor so it appears in the generated type signature.
The text was updated successfully, but these errors were encountered: