A static class that provides a global Lua virtual machine. More...
Classes | |
struct | Result |
Stores a Lua interpreter result (LuaValue) and provides easy conversion to basic types. More... | |
Static Public Member Functions | |
static Result | Run (string luaCode, bool debug, bool allowExceptions) |
Runs the specified luaCode. | |
static Result | Run (string luaCode, bool debug) |
Runs the specified luaCode. | |
static Result | Run (string luaCode) |
Run the specified luaCode. | |
static bool | IsTrue (string luaCondition, bool debug, bool allowExceptions) |
Evaluates a boolean condition defined in Lua code. | |
static bool | IsTrue (string luaCondition, bool debug) |
Evaluates a boolean condition defined in Lua code. | |
static bool | IsTrue (string luaCondition) |
Evaluates a boolean condition defined in Lua code. | |
static bool | IsOnlyComment (string luaCode) |
static Language.Lua.LuaValue | RunRaw (string luaCode, bool debug, bool allowExceptions) |
Runs Lua code and returns an array of return values. | |
static Language.Lua.LuaValue | RunRaw (string luaCode, bool debug) |
Runs Lua code and returns an array of return values. | |
static Language.Lua.LuaValue | RunRaw (string luaCode) |
Runs Lua code and returns an array of return values. | |
static void | RegisterFunction (string functionName, object target, MethodInfo method) |
Registers a C# function with the Lua interpreter so it can be used in Lua. | |
static void | UnregisterFunction (string functionName) |
Unregisters a C# function. | |
Properties | |
static Result | noResult [get] |
static Result | NoResult [get] |
static bool | wasInvoked [get, set] |
Lua.RunRaw sets this Boolean flag whenever it's invoked. | |
static bool | muteExceptions [get, set] |
Set true to not log exceptions to the Console. | |
static bool | warnRegisteringExistingFunction [get, set] |
Set true to log warnings if trying to register a function under a name that's already registered. | |
static Language.Lua.LuaTable | environment [get] |
Provides direct access to the Lua Interpreter environment. | |
static Language.Lua.LuaTable | Environment [get] |
A static class that provides a global Lua virtual machine.
This class provides a layer of abstraction between the low level Lua implementation (in this case LuaInterpreter) and the Dialogue System.
|
inlinestatic |
|
inlinestatic |
Evaluates a boolean condition defined in Lua code.
The code is not logged to the console, and exceptions are ignored.
true
if luaCode evaluates to true; otherwise, false
luaCondition | The conditional expression to evaluate. Do not include "return" in front. |
|
inlinestatic |
Evaluates a boolean condition defined in Lua code.
Exceptions are ignored.
true
if luaCode evaluates to true; otherwise, false
luaCondition | The conditional expression to evaluate. Do not include "return" in front. |
debug | If |
|
inlinestatic |
Evaluates a boolean condition defined in Lua code.
true
if luaCode evaluates to true; otherwise, false
. luaCondition | The conditional expression to evaluate. Do not include "return" in front. |
debug | If true , logs the Lua command to the console. |
allowExceptions | If true , exceptions are passed up to the caller. Otherwise they're caught and ignored. |
if (Lua.IsTrue("height > 6")) { ... }
|
inlinestatic |
Registers a C# function with the Lua interpreter so it can be used in Lua.
path | The name of the function in Lua. |
target | Target object containing the registered method. Can be null if a static method. |
function | The method that will be called from Lua. |
|
inlinestatic |
Run the specified luaCode.
The code is not logged to the console, and exceptions are ignored.
luaCode | The Lua code to run. Generally, if you want a return value, this string should start with "return". |
|
inlinestatic |
Runs the specified luaCode.
Exceptions are ignored.
luaCode | The Lua code to run. Generally, if you want a return value, this string should start with "return". |
debug | If set to true , logs the Lua command to the console. |
|
inlinestatic |
Runs the specified luaCode.
luaCode | The Lua code to run. Generally, if you want a return value, this string should start with "return". |
debug | If true , logs the Lua command to the console. |
allowExceptions | If true , exceptions are passed up to the caller. Otherwise they're caught and ignored. |
float myHeight = Lua.Run("return height").asFloat;
|
inlinestatic |
Runs Lua code and returns an array of return values.
Does not log to console and ignores exceptions.
null
if the code generates an error. luaCode | The Lua code to run. If you want a return value, this string should usually start with "<c>return</c>". |
|
inlinestatic |
Runs Lua code and returns an array of return values.
Ignores exceptions.
null
if the code generates an error. luaCode | The Lua code to run. If you want a return value, this string should usually start with "<c>return</c>". |
debug | If true , logs the Lua command to the console. |
|
inlinestatic |
Runs Lua code and returns an array of return values.
null
if the code generates an error. luaCode | The Lua code to run. If you want a return value, this string should usually start with "<c>return</c>". |
debug | If true , logs the Lua command to the console. |
allowExceptions | If true , exceptions are passed up to the caller. Otherwise they're caught and logged but ignored. |
|
inlinestatic |
Unregisters a C# function.
functionName | Function name. |
|
staticget |
Provides direct access to the Lua Interpreter environment.
The Interpreter environment.
|
staticget |
|
staticgetset |
Set true to not log exceptions to the Console.
true
if mute exceptions; otherwise, false
.
|
staticget |
|
staticget |
|
staticgetset |
Set true to log warnings if trying to register a function under a name that's already registered.
|
staticgetset |
Lua.RunRaw sets this Boolean flag whenever it's invoked.
true
when Lua.RunRaw is invoked.