From dabbcc0ebf5aee20eb77166e8d6c95acfc93595a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=90=8D?= <3077614386@qq.com> Date: Sun, 28 Jan 2024 17:25:54 +0800 Subject: [PATCH] 1 --- .../Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index f417fc0a..4f31c3a8 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -1029,6 +1029,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour } private void OnDestroy() { + if (airRoute) + Destroy(airRoute.gameObject); for (int i = 0; i < unmannedAerialVehicleManages.Count; i++) { if (unmannedAerialVehicleManages[i] == null) @@ -1038,7 +1040,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour } StopCoroutine(ShowRadarTips(0, 0)); OnActivationChanged -= OnActivationChangedHandler; - Destroy(airRoute.gameObject); + }