Laylua allows you to easily embed Lua 5.4 in your .NET application.
Highlights:
- plug and play
- Roslyn source generators and analyzers
- automatic type marshaling
- proper handling of exceptions and Lua errors
- built with sandboxing in mind; limit memory, instructions, and what scripts can access
- optimized and type-safe, with no value type boxing
usingLaylua;usingLaylua.Marshaling;usingvarlua=newLua();lua.OpenLibrary(LuaLibraries.Standard.Base);lua["player"]=newPlayer("Steve");lua.Execute(""" player:TakeDamage(25) print(player.Name, player.Health) """);[LuaType]publicpartialclassPlayer(stringname){publicstringName{get;}=name;publicintHealth{get;privateset;}=100;publicvoidTakeDamage(intamount){Health-=amount;}}