Hey all! Currently trying to integrate Lua into my application as a scripting extension for rapid development. I wish to allow the user to implement custom components with something like the following structure:
local Test = { }
function Test:Init() end
function Test:Update(delta) end
function Test:Destroy() end
return Test
If I have a Lua instance stored in a struct, how might I also store within this struct, references to the callbacks defined in that loaded script? For instance, I want to load this table on initialization to get references to each of the callbacks and then be able to call the user-defined Test:Update(delta) function each frame.
Hey all! Currently trying to integrate Lua into my application as a scripting extension for rapid development. I wish to allow the user to implement custom components with something like the following structure:
If I have a
Lua
instance stored in a struct, how might I also store within this struct, references to the callbacks defined in that loaded script? For instance, I want to load this table on initialization to get references to each of the callbacks and then be able to call the user-definedTest:Update(delta)
function each frame.