A Lua-like scripting engine implemented in C# for .Net (No Native Libs)
|
|
10 years ago | |
|---|---|---|
| src | 10 years ago | |
| .gitattributes | 11 years ago | |
| .gitignore | 11 years ago | |
| .travis.yml | 10 years ago | |
| LICENSE | 10 years ago | |
| README.md | 10 years ago | |
| bfg.jar | 10 years ago |
A complete Lua solution written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms.
Features:
For highlights on differences between MoonSharp and standard Lua, see http://www.moonsharp.org/moonluadifferences.html
Please see http://www.moonsharp.org for downloads, infos, tutorials, etc.
License
The program and libraries are released under a 3-clause BSD license - see the license section.
Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua). Debugger icons are from the Eclipse project (https://www.eclipse.org/).
Usage
Use of the library is easy as:
double MoonSharpFactorial()
{
string script = @"
-- defines a factorial function
function fact (n)
if (n == 0) then
return 1
else
return n*fact(n - 1)
end
end
return fact(5)";
DynValue res = Script.RunString(script);
return res.Number;
}
For more in-depth tutorials, samples, etc. please refer to http://www.moonsharp.org/getting_started.html