First, it is possible to do like this:
local delay = 1000
local timer = Timer.delayedCall(delay,
function(data)
print(data)
end,
20)
But, it seems not possible to do like this:
function Game:DoSomething(data)
print(data)
end
local timer = Timer.delayedCall(delay,
self.DoSomething,
20)
In other words, I would like to define the function outside (so to be reused by others). However, that seems not possible. Or did I do it wrong?
If what you want is have Timer.delayedCall call a method with multiple arguments in a generic way, you can do it like this:
PS: this is my first post on SO, sorry if it isn't formatted correctly...