我在任何地方都找不到它的文档:/
(问题是标题)
找到 this但无法让它工作。
function onCollision( event )
--code--
end
Runtime:addEventListener( "collision", listener )
local function listener( event )
timer.performWithDelay(
1000, onCollision )
end
最佳答案
您的问题是代码顺序之一。 function
本质上是设置给定符号的值。 From the Lua manual :
The statement
function f () body end
translates to
f = function () body end
因此,当您将 listener
传递给 addEventListener
时,listener
为 nil
。重新排序,它应该可以工作:
function onCollision( event )
--code--
end
local function listener( event )
timer.performWithDelay(1000, onCollision )
end
Runtime:addEventListener( "collision", listener )
关于iphone - 我怎样才能延迟或暂停 ansca 电晕中的功能? (路亚),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7138548/