2015, scripting asset.
Lua Framework allows you to easily and automatically convert data defined in the Lua script language to .NET objects, and vice-versa. It works like XML or JSON readers, but instead of a markup language, you now have access to a powerful programming language to define your game or application’s logic. Like many top-selling games did, choosing Lua can greatly streamline the game design process and most importantly, allow easy-to-implement modding capacities.
Lua Framework is built on the power of MoonSharp, a modern and free .NET implementation of the Lua language. As opposed to previous .NET to Lua bridges such as LuaInterface, NLua or UniLua, MoonSharp provides a very intuitive user experience with fast learning curve, fast performance, is regularly updated, supports latest Lua 5.2, and supports Unity’s Mono implementation of the .NET language out of the box, on all Unity versions and licenses, including iOS.
Lua Framework has two main modules: LuaReader and LuaWriter. LuaReader automatically maps Lua variables and tables to .NET objects. LuaWriter creates a Lua script representation of .NET objects. Currently supported types are:
- Built-in types: bool, int, float, double, string, byte & decimal;
- Unity-specific structs: Color, Color32, Rect, Vector2, Vector3 & Vector4;
- ANY custom classes with public properties;
- One-dimensional or two-dimensional arrays of any supported type;
- Generic Lists or Dictionaries of any supported type;
- Any possible nesting, for example List<Dictionary<string, Vector3>>.
The code for the Lua Framework is clean and professional, performance-optimized (it can process tens of thousands of lines of Lua code under seconds), with full intellisense support.
- Added the possibility of adding custom Lua readers to process sructs or data with custom formatting.
- Added support for Lua functions (closures).
- Updated demo scene with test for custom readers.
- Updated documentation.