2016-10-14

MoonSharp goes 2.0!

A lot of great features. First of all, MoonSharp is switching to a model where sources are provided for Unity. Second, a lot of platforms previously totally unsupported (WebGL, Unity WSA, .NET Core) are now working great. Third, the Visual Studio Code debugger becomes the “default” supported debugger. The remote, flash based debugger will still be maintained, but no new features will be added and testing on it will be little.

What’s new:

Visual Studio Code debugging now supports multiple script objects

Support for .NET Core

Support for Unity WebGL

Support for WSA targets at source level

Improved support of other Unity targets

Unity package is now included inside distribution zip file (easier to use and faster to deploy than the asset store)

Warning : this version has some minor but breaking changes for custom debuggers. If you have implemented a custom debugger, be prepared to add a couple of new methods to your object (empty methods are enough).

2016-05-16

MoonSharp 1.6.0.0 released:

Added a RethrowExceptionNested option to Script.GlobalOptions which instead of doing a plain re-throw of exceptions, embeds them in the InnerException property of a new exception object. Useful to simplify handling (newer exceptions are automatically decorated) and to preserve stack traces on Mono/Unity (annoying Mono bug..)

2016-01-28

Just as a little peek into what is coming. Soon.

Work is going on towards reaching IL2CPP maximum compatibility. Let’s clarify. As now MoonSharp has quite a good degree of compatibility with IL2CPP but it requires registering the scripts manually (or using DoString instead of DoFile) and a lot of painful fiddling with the link.xml file.

But why fiddling with reflection when one can use no reflection at all ? Soon MoonSharp will include a little utility which will take a snapshot of what types are registered for script interop, and will create a C# source file on the fly which allows for no reflection (thus maximum IL2CPP compatibility), faster startup and faster execution, specially on AOT/IL2CPP platforms (like iOS) and in corner cases. At the price of a little more workflow effort (but very little) and some little extra requirements on interop types.. which can handily be solved through proxy objects.

If you are not using Unity or Xamarin, you probably have less reasons to rely on these (desktop .NET and Mono are a lot more powerful), but you’ll still benefit from faster startup and execution.

Stay tuned for more anticipations.

2016-01-24

MoonSharp 1.2.1.0 has been released!

Support for proxy objects - a nice way to encapsulate objects exposed to script and create the base for many clever tricks

Support for sub-objects in property assigners

MoonSharpHide attribute to specify members not to be exposed to Lua scripts

MoonSharpVisible attribute now can be added to constructors too

MoonSharpHidden attribute as a shortcut for MoonSharpVisible(false) also in an easier namespace to use

UnityAssetScriptLoader has new constructors which don’t require reflection use (to ease IL2CPP porting, which is a pain in any case)

Fixed a weird bug with using the same destination variable twice in a for-iterator statement (while syntax is parsed correctly, behavior is still undefined as it’s not really correct Lua)

2015-05-20

MoonSharp 0.9.4 has been released, with a lot of new features, mostly revolving around interop with userdata with elements which could not be
interacted with before (events, enums, vararg functions, const and readonly members, etc.).

Documentation and tutorials will be updated in the next few days to reflect the latest changes!.

Note 2: setting a field and methods with ref/out paramenters at the moment always use reflection, whatever
the InteropAccessMode is. Use properties and/or methods returning DynValue tuples for faster access.