This commit is contained in:
YangHua 2024-01-28 17:27:19 +08:00
commit 8dbbc60083
4 changed files with 12 additions and 9 deletions

View File

@ -368,7 +368,7 @@ public class Spectrumdetection : MonoBehaviour
{ {
SpectrumdetectionUI.SetActive(true); SpectrumdetectionUI.SetActive(true);
} }
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0") if (GlobalFlag.blueOrRed == 1)
{ {
EquipmentCommon equipmentCommon1 = GetComponent<EquipmentCommon>(); EquipmentCommon equipmentCommon1 = GetComponent<EquipmentCommon>();
if (equipmentCommon.deviceID == equipmentCommon1.deviceID) if (equipmentCommon.deviceID == equipmentCommon1.deviceID)

View File

@ -131,14 +131,14 @@ public class RadarManger : MonoBehaviour
} }
void Start() void Start()
{ {
equipmentCommon = GetComponent<EquipmentCommon>(); equipmentCommon = GetComponent<EquipmentCommon>();
// 订阅布尔值变化事件 // 订阅布尔值变化事件
OnActivationChanged += OnActivationChangedHandler; OnActivationChanged += OnActivationChangedHandler;
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage); DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
} }
#region #region
/// <summary> /// <summary>
/// 导条变化调用 /// 导条变化调用
@ -199,10 +199,10 @@ public class RadarManger : MonoBehaviour
void CreateRadarUI() void CreateRadarUI()
{ {
imageprs.transform.localScale = Vector3.zero; imageprs.transform.localScale = Vector3.zero;
aniRandarUI =imageprs.GetComponent<Animator>(); aniRandarUI = imageprs.GetComponent<Animator>();
RadarRotationSpeed(TurntableSpeed); RadarRotationSpeed(TurntableSpeed);
} }
/// <summary> /// <summary>
/// 数据写入 /// 数据写入
/// </summary> /// </summary>
@ -324,8 +324,9 @@ public class RadarManger : MonoBehaviour
/// </summary> /// </summary>
private void OnMouseDown() private void OnMouseDown()
{ {
if (equipmentCommon.isPlayer) if (equipmentCommon.isPlayer && GlobalFlag.blueOrRed == 1)
{ {
imageprs.gameObject.SetActive(true); imageprs.gameObject.SetActive(true);
} }
} }

View File

@ -250,7 +250,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
/// <summary> /// <summary>
private void Detection() private void Detection()
{ {
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0)) if (GlobalFlag.blueOrRed == 1 && Input.GetMouseButtonDown(0))
{ {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit; RaycastHit hit;

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);
} }