2025-06-04 05:02:57 +08:00

19 lines
468 B
Plaintext

--選擇結點,邏輯或.執行到第一個不為failure的
autoImport("LParentNode")
LSelectorNode = class('LSelectorNode',LParentNode)
function LSelectorNode:Update()
local node
local state
for i=1,#self.childrenNodes do
node = self.childrenNodes [i];
state = node:Update()
-- if (state == TaskState.Inactive) then
-- continue;
-- print("selector",state)
if (state ~= TaskState.Failure) then
return state
end
end
return TaskState.Failure;
end