嘿,我正在使用此代码在场景中移动(动画)我的对象但它会泄漏内存并停止响应。
//transition back
local function goBack( )
transition.to ( wall2, { time = 10000, x = 100, y = 310, onComplete = startTransition})
transition.to ( wall, { time = 10000, x = 700, y = 200, onComplete = startTransition})
transition.to (gate_a, { time = 10000, x = 100, y = 255, onComplete = startTransition})
transition.to ( stargate_a, { time = 10000, x = 100, y = 255, onComplete = startTransition})
end
//transition start
function startTransition( )
transition.to ( wall2, { time = 10000, x = 700, y = 310, onComplete = goBack})
transition.to ( wall, { time = 10000, x = 100, y = 200, onComplete = goBack})
transition.to ( gate_a, { time = 10000, x = 700, y = 255, onComplete = goBack})
transition.to ( stargate_a, { time =10000, x = 700, y = 255, onComplete = goBack})
end
startTransition()
如何在不泄漏任何内存的情况下正确移动对象?