情况是我需要访问调用 eventListener 的对象
例如:如果我要添加:balls[ball]:addEventListener( "collision", removeBricks)
如何balls[ball]
在 removeBricks 函数中访问?
function removeBricks(event)
print("caller: " .. balls[ball])
...
end
balls[ball]:addEventListener( "collision", removeBricks)
我试过的:
balls["ball"]:addEventListener( "collision", removeBricks(event, balls["ball"]))