2022-12-15 13:49:38 +00:00
|
|
|
@tool
|
|
|
|
extends BTAction
|
|
|
|
|
|
|
|
@export var animation_name: String
|
2022-12-16 03:16:19 +00:00
|
|
|
@export var animation_player: NodePath
|
2022-12-15 13:49:38 +00:00
|
|
|
|
|
|
|
var _player: AnimationPlayer
|
|
|
|
|
|
|
|
|
|
|
|
func _generate_name() -> String:
|
|
|
|
return "StartAnimation \"%s\"" % animation_name
|
|
|
|
|
|
|
|
|
|
|
|
func _setup() -> void:
|
2022-12-16 03:16:19 +00:00
|
|
|
_player = agent.get_node(animation_player)
|
2022-12-15 13:49:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _tick(p_delta: float) -> int:
|
|
|
|
_player.play(animation_name)
|
|
|
|
return SUCCESS
|