This commit is contained in:
账号名 2024-01-28 17:25:54 +08:00
parent eeb9868254
commit dabbcc0ebf
1 changed files with 3 additions and 1 deletions

View File

@ -1029,6 +1029,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
} }
private void OnDestroy() private void OnDestroy()
{ {
if (airRoute)
Destroy(airRoute.gameObject);
for (int i = 0; i < unmannedAerialVehicleManages.Count; i++) for (int i = 0; i < unmannedAerialVehicleManages.Count; i++)
{ {
if (unmannedAerialVehicleManages[i] == null) if (unmannedAerialVehicleManages[i] == null)
@ -1038,7 +1040,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
} }
StopCoroutine(ShowRadarTips(0, 0)); StopCoroutine(ShowRadarTips(0, 0));
OnActivationChanged -= OnActivationChangedHandler; OnActivationChanged -= OnActivationChangedHandler;
Destroy(airRoute.gameObject);
} }