Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:Test:CreateBT2() #1

Open
easyboy3 opened this issue Apr 26, 2021 · 2 comments
Open

bug:Test:CreateBT2() #1

easyboy3 opened this issue Apr 26, 2021 · 2 comments

Comments

@easyboy3
Copy link

When two BoolComparison return false..the unity crash!
local boolCom3002 = BT.BoolComparison:New(nil,true,false)
local boolCom3003 = BT.BoolComparison:New(nil,true,false)

@easyboy3
Copy link
Author

--region treeSolve
function BT.BTree:IsParent(parentTaskIndex, childTaskIndex)
while childTaskIndex ~= 0 do
if childTaskIndex == parentTaskIndex then
return true
end
childTaskIndex = self.tParentIndex[childTaskIndex]
end
end

I had find childTaskIndex==nil
难顶~

@easyboy3
Copy link
Author

function BT.BTree:PushTask(taskIndex, stackIndex)
local task = self.tTaskList[taskIndex]
local stack = self.tRunStack[stackIndex]
if stack == nil then
return
end

if stack:Empty() == false and stack:Peek() == taskIndex then
    return
end
stack:Push(taskIndex)

task:OnStart()

end

An other question is ~~ "‘’‘’‘’ task:OnStart()‘’‘’this function here ,like Onupdate() run every frame ,Is that Right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant