otherworldly_simulation/scene/test/action_await_time.gd
2024-10-25 15:41:39 +08:00

17 lines
435 B
GDScript

extends ActionLeaf
@onready var timer: Timer = $Timer
var is_self_started:bool=false
func tick(actor:Node,blackboard:Blackboard):
if not is_self_started and timer.is_stopped():
timer.start(get_parent().await_time)
is_self_started=true
return RUNNING
elif is_self_started and not timer.is_stopped():
return RUNNING
elif is_self_started and timer.is_stopped():
is_self_started=false
return SUCCESS
else:
return FAILED