From 03f42ac70efbeb3ab8d095cc02cf5062a895dbe7 Mon Sep 17 00:00:00 2001 From: yulong <1838206582@qq.com> Date: Wed, 6 Mar 2024 19:47:47 +0800 Subject: [PATCH] 1 --- .../UAV/UnmannedAerialVehicleManage.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index f4b3e623..ec0c2fca 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -238,7 +238,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour equipmentCommon.SetDatabaseInfo("bdxx", index.ToString()); } - + /// @@ -395,14 +395,19 @@ public class UnmannedAerialVehicleManage : MonoBehaviour Debug.Log(hit.distance); if (hit.distance <= 1f) { - //Debug.Log("ιšθ—δΊ†"); - gamePos.gameObject.SetActive(false); - gamemap.gameObject.SetActive(false); + if (gamemap && gamePos) + { + gamePos.gameObject.SetActive(false); + gamemap.gameObject.SetActive(false); + } } else { - gamePos.gameObject.SetActive(true); - gamemap.gameObject.SetActive(true); + if (gamemap && gamePos) + { + gamePos.gameObject.SetActive(true); + gamemap.gameObject.SetActive(true); + } } }