diff --git a/src/player/ArrayTween.gd b/src/player/ArrayTween.gd index baf9abb..15d3f31 100644 --- a/src/player/ArrayTween.gd +++ b/src/player/ArrayTween.gd @@ -19,8 +19,6 @@ func _ready(): # 使用节点进行动画 func interpolate_array(values:Array) -> void: - if values.size() < 2: - return if is_active(): stop_all() self.index = 0 diff --git a/src/player/Player.gd b/src/player/Player.gd index 8903060..d03c829 100644 --- a/src/player/Player.gd +++ b/src/player/Player.gd @@ -57,6 +57,8 @@ func _unhandled_input(event): var start_id = astar.get_closest_point(position) var end_id = astar.get_closest_point(event.position) var paths = astar.get_point_path(start_id,end_id) + if paths.size() < 2: + return animation_tree.active = true array_tween.interpolate_array(paths)