Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

252 Commits

Repository files navigation

Laylua

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

Example

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;}}

Documentation

Check out the wiki.

Sponsor this project

Used by

Contributors

Languages