public void OnEnable()
{
// Make the functions available to Lua: (Replace these lines with your own.)
Lua.RegisterFunction("ExampleMethod", this, SymbolExtensions.GetMethodInfo(() => ExampleMethod((string)null)));
}
public void OnDisable()
{
if (unregisterOnDisable)
{
// Remove the functions from Lua: (Replace these lines with your own.)
Lua.UnregisterFunction("ExampleMethod");
}
}
I then registered it in the Lua custom function table, and tried to use it in a dialogue tree. I tried to pass the display name of the current conversant as a string, but I have been getting a syntax error when using Actor[Variable["Conversant"]] or Variable["Conversant"] as the string parameter.
Note that an actor's table index (aka a dictionary key in C#) may be different from its name. (more info) If the actor's name is "Mister Ed", then its table index will be "Mister_Ed". If you reference the Actor[] table in your Script, use Variable["ConversantIndex"]: