This commit is contained in:
账号名 2023-11-24 13:44:35 +08:00
parent d19cf2fead
commit acb5d28826
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@ public class DistanceMeasurement : MonoBehaviour
{ {
if (isPathCanBePlanned) if (isPathCanBePlanned)
{ {
if (Input.GetMouseButtonDown(0)&& IsPointerOverUI()) if (Input.GetMouseButtonDown(0)&& !IsPointerOverUI())
{ {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit; RaycastHit hit;
@ -27,7 +27,7 @@ public class DistanceMeasurement : MonoBehaviour
AddMarker(hit.point); AddMarker(hit.point);
} }
} }
if (Input.GetMouseButtonDown(1) && IsPointerOverUI()) if (Input.GetMouseButtonDown(1) && !IsPointerOverUI())
{ {
ClearMarkers(); ClearMarkers();
} }
@ -59,6 +59,7 @@ public class DistanceMeasurement : MonoBehaviour
newMarkers[markers.Length] = go.transform; newMarkers[markers.Length] = go.transform;
markers = newMarkers; markers = newMarkers;
unmannedAerialVehicleManage.positions.Enqueue(go.transform.position); unmannedAerialVehicleManage.positions.Enqueue(go.transform.position);
go.transform.SetParent(transform);
} }
// 根据新的标记点数组重新绘制路径 // 根据新的标记点数组重新绘制路径