From acb5d28826ac961f36885b56c6133d08db87d2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=90=8D?= <3077614386@qq.com> Date: Fri, 24 Nov 2023 13:44:35 +0800 Subject: [PATCH] bug --- .../Scripts/ModelFunction/DrawingLine/DistanceMeasurement.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Zion/Scripts/ModelFunction/DrawingLine/DistanceMeasurement.cs b/Assets/Zion/Scripts/ModelFunction/DrawingLine/DistanceMeasurement.cs index ae3ee147..494e7d5b 100644 --- a/Assets/Zion/Scripts/ModelFunction/DrawingLine/DistanceMeasurement.cs +++ b/Assets/Zion/Scripts/ModelFunction/DrawingLine/DistanceMeasurement.cs @@ -18,7 +18,7 @@ public class DistanceMeasurement : MonoBehaviour { if (isPathCanBePlanned) { - if (Input.GetMouseButtonDown(0)&& IsPointerOverUI()) + if (Input.GetMouseButtonDown(0)&& !IsPointerOverUI()) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; @@ -27,7 +27,7 @@ public class DistanceMeasurement : MonoBehaviour AddMarker(hit.point); } } - if (Input.GetMouseButtonDown(1) && IsPointerOverUI()) + if (Input.GetMouseButtonDown(1) && !IsPointerOverUI()) { ClearMarkers(); } @@ -59,6 +59,7 @@ public class DistanceMeasurement : MonoBehaviour newMarkers[markers.Length] = go.transform; markers = newMarkers; unmannedAerialVehicleManage.positions.Enqueue(go.transform.position); + go.transform.SetParent(transform); } // 根据新的标记点数组重新绘制路径