From 1b038e0115530fc405283bca508d331133b5545e Mon Sep 17 00:00:00 2001 From: freewu32 <2217332562@qq.com> Date: Sat, 5 Sep 2020 14:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=BA=E7=89=A9=E8=BF=90?= =?UTF-8?q?=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/player/ArrayTween.gd | 2 -- src/player/Player.gd | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) 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)