13 lines
313 B
GDScript
13 lines
313 B
GDScript
extends ActionLeaf
|
|
|
|
func tick(actor:Node,black_board:Blackboard):
|
|
var unit:Unit=actor
|
|
if black_board.has_value("target"):
|
|
|
|
var target=black_board.get_value("target")
|
|
if target is Food and unit.is_unit_instance_in_touch_area(target) :
|
|
unit.eat(target)
|
|
return SUCCESS
|
|
return FAILURE
|
|
return FAILURE
|