这里是示例代码:
local function name()
startingAction()
if trigger() then
endingAction()
return true
else
resetAction()
startingAction()
if trigger() then
endingAction()
return true
else
resetAction()
startingAction()
if trigger() then
endingAction()
return true
else
return false
end
end
end
基本上是一个执行某项功能的函数,但是如果在它之间做不到,我想通过在其前面加上另一个动作来重复此函数。样本深度为3级,但我希望能够控制重复次数。有什么建议吗?