uLua v2.2.0
A Lua Modding Framework for Unity.
|
Wrapper class which streamlines use of the MoonSharp Lua context. More...
Static Public Member Functions | |
static void | Call (DynValue Function, params object[] args) |
Calls a Lua function with optional parameters. More... | |
static void | Clear () |
Resets and initialises the Lua context | |
static void | ExecuteScript (string Code, string codeFriendlyName="", bool overwriteExisting=false) |
Executes the specified code within the Lua context. More... | |
static void | Log (string String) |
Logs a message to the console. More... | |
static void | LogError (string String) |
Logs an error to the console. More... | |
static void | LogWarning (string String) |
Logs a warning to the console. More... | |
static T | Get< T > (string Name) |
Finds and returns the Lua global with the specified name. More... | |
static void | ObjectCall< T > (T Object, string FunctionName, params object[] args) |
Calls a Lua object's function. More... | |
static void | Remove (string Name) |
Removes a global from the Lua context. More... | |
static void | Set (string Index, object Value) |
Exposes an object as a global with the specified index in Lua. More... | |
static DynValue | ValueToLuaValue (object Value) |
Converts an object to a DynValue. More... | |
Properties | |
static DynValue | NewFunction [get] |
Returns a new Lua function. More... | |
static Table | NewTable [get] |
Returns a new Lua table. More... | |
static ScriptLoaderBase | ScriptLoader [get, set] |
Gets or sets the Lua script loader. More... | |
Wrapper class which streamlines use of the MoonSharp Lua context.
Implemented as a static class to ensure the Lua context is available application-wide.
|
inlinestatic |
|
inlinestatic |
Executes the specified code within the Lua context.
Code | The Lua code to execute. |
codeFriendlyName | (Optional) A unique identifier for this script. Not recommended to leave blank, especially if the same script is likely to be executed more than once. |
overwriteExisting | (Optional) If true, the method will overwrite any previous script with the same filename. Otherwise, any previous script will be called from a hash table. |
|
inlinestatic |
Finds and returns the Lua global with the specified name.
The returned object is converted to the type specified by the generic type parameter T
.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Calls a Lua object's function.
Object | The object whose function will be called. The generic type T must implement the ILuaObject interface. |
FunctionName | The name of the callback function to be called. |
args | (Optional) Parameters for the callback function. |
T | : | ILuaObject |
|
inlinestatic |
|
inlinestatic |
Exposes an object as a global with the specified index in Lua.
For object types that implement the ILuaObject interface, use uLua.API.Expose()
instead.
|
inlinestatic |
Converts an object to a DynValue.
May be used with any C# object type.
|
staticget |
Returns a new Lua function.
Used as a placeholder for empty callback functions.