Accessing Methods on other scripts though Lua
Posted: Tue Aug 02, 2022 9:49 am
Hi Tony,
I have a main dialogue class (Dialogue System Helper Methods), which contains the registered LUA functions and references to the classes which contain methods to handle dialogue system interactions for each map (MapA, MapB).
How do i register a function in the main class, to call a function in the map class? Pretty sure I had this working before, but struggling with it. Here's what I've tried:
Thanks!
I have a main dialogue class (Dialogue System Helper Methods), which contains the registered LUA functions and references to the classes which contain methods to handle dialogue system interactions for each map (MapA, MapB).
How do i register a function in the main class, to call a function in the map class? Pretty sure I had this working before, but struggling with it. Here's what I've tried:
Code: Select all
Lua.RegisterFunction("AMethod", mapA, SymbolExtensions.GetMethodInfo(() => mapA.AMethod()));
Lua.RegisterFunction("AMethod", mapA, SymbolExtensions.GetMethodInfo(() => AMethod()));
Lua.RegisterFunction("AMethod", this, SymbolExtensions.GetMethodInfo(() => mapA.AMethod()));