Game Development Reference
In-Depth Information
local result = _EvaluateSelector(
self, child, deltaTimeInMillis);
-- Unable to find an Action to run, return
failure.
if (not result.result) then
return { result = false };
elseif (result.result and result.node ~= nil)
then
-- Found an Action to execute, pass the
result
-- back to the caller.
return result;
end
-- A selector must return an Action to be
considered
-- successful, if no Action was found, then the
-- selector failed.
elseif (child.type_ ==
BehaviorTreeNode.Type.SEQUENCE) then
local result = _EvaluateSequence(
self, child, deltaTimeInMillis);
-- Sequence reported failure, propagate failure
to the
-- caller.
if (not result.result) then
return { result = false };
elseif (result.result and result.node ~= nil)
then
-- Found an Action to execute, pass the
result
-- back to the caller.
return result;
end
Search WWH ::




Custom Search