Files
pomchronicles/ai/tasks/decorators/busy.gd

23 lines
414 B
GDScript

@tool
extends BTDecorator
var prev_busy : bool
func _get_task_icon():
return load("res://ai/icons/stopwatch.png")
func _enter() -> void:
if agent.get("busy") != null:
prev_busy = agent.busy
agent.busy = true
func _exit() -> void:
if agent.get("busy") != null:
agent.busy = prev_busy
# Called to generate a display name for the task (requires @tool).
func _generate_name() -> String:
return "Busy"