AnnulusGames / Lua-CSharp

High performance Lua interpreter implemented in C# for .NET and Unity
MIT License
184 stars 8 forks source link

Does Lua-CSharp support nullable values? #51

Open Dismalitie opened 2 weeks ago

Dismalitie commented 2 weeks ago

Hey, I was wondering if this supports nullable values in functions (string?, int? etc...) because when calling an empty function from Lua:

w.create()

it throws:

bad argument #1 to 'create' (value expected)

This is the C# function:

[LuaMember("create")]
public static void Create(string? title, int? width = 700, int? height = 400)
{
    f = new Form()
    {
        Text = title == null ? "gluaWindow" : title,
        Width = width == null ? 700 : (int)width,
        Height = height == null ? 400 : (int)height,
    };
}

I don't know if this has to do with issue #50 or whether Lua and / or this library doesn't support nullables.