説明
The HookObjectChange Lua function automatically calls a function when a grandMA3 object changes.
引数
- function:
This must be the name of a function. This function is triggered every time the provided grandMA3 object changes.
- handle:
This is the handle for the grandMA3 objects that should be monitored for changes. The triggered function passes this handle on as the first argument.
- handle:
The handle must be for the plugin creating this HookObjectChange - it is the handle for "this" plugin.
- handle (オプション):
This optional handle is for an object that will be passed on to the triggered function (as the third argument).
戻り値
- integer:
The function returns an integer identifying the hook. This can be saved to unhook the object later.
例
To call a function every time the content of the sequence pool changes, create a plugin with this code:
|
local luaComponentHandle = select(4,...)
function Main() local hookObject = DataPool().Sequences local pluginHandle = luaComponentHandle:Parent() SequenceHookId = HookObjectChange(MySequencePoolCallback, hookObject, pluginHandle) Printf("HookId: " .. SequenceHookId) end
function MySequencePoolCallback(obj) Printf(tostring(obj.name) .. " changed!") end
return Main
|