mirror of
https://github.com/tonytins/citylimits
synced 2025-06-26 17:54:43 -04:00
Behavior Tree addon
This commit is contained in:
parent
5de5a0c315
commit
5fa863114a
50 changed files with 1762 additions and 3 deletions
18
addons/beehave/nodes/composites/selector.gd
Normal file
18
addons/beehave/nodes/composites/selector.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
extends Composite
|
||||
|
||||
class_name SelectorComposite, "../../icons/selector.svg"
|
||||
|
||||
func tick(actor, blackboard):
|
||||
for c in get_children():
|
||||
var response = c.tick(actor, blackboard)
|
||||
|
||||
if c is ConditionLeaf:
|
||||
blackboard.set("last_condition", c)
|
||||
blackboard.set("last_condition_status", response)
|
||||
|
||||
if response != FAILURE:
|
||||
if c is ActionLeaf and response == RUNNING:
|
||||
blackboard.set("running_action", c)
|
||||
return response
|
||||
|
||||
return FAILURE
|
Loading…
Add table
Add a link
Reference in a new issue