2023-06-12 22:06:48 +02:00
|
|
|
class_name ThrowBallAction
|
|
|
|
extends ActionLeaf
|
|
|
|
|
|
|
|
func before_run(actor, _blackboard):
|
2023-07-01 13:26:45 +02:00
|
|
|
actor.play_hit_ball_animation()
|
2023-06-12 22:06:48 +02:00
|
|
|
|
2023-07-01 17:12:02 +02:00
|
|
|
func tick(actor, _blackboard):
|
2023-07-01 13:26:45 +02:00
|
|
|
if !actor.hit_ball_animation_finished:
|
2023-06-12 22:06:48 +02:00
|
|
|
return RUNNING
|
2023-07-01 13:26:45 +02:00
|
|
|
actor.throw_ball()
|
|
|
|
return SUCCESS
|
2023-06-12 22:06:48 +02:00
|
|
|
|
|
|
|
func after_run(actor, _blackboard):
|
2023-07-01 13:26:45 +02:00
|
|
|
actor.play_idle_animation()
|