diff --git a/Assets/Temp/Scripts/Spectrumdetection.cs b/Assets/Temp/Scripts/Spectrumdetection.cs index 19e5527e..2fb40066 100644 --- a/Assets/Temp/Scripts/Spectrumdetection.cs +++ b/Assets/Temp/Scripts/Spectrumdetection.cs @@ -357,15 +357,9 @@ public class Spectrumdetection : MonoBehaviour } } - /// - /// 点击物体生成页面 - /// - /// - private void Emittedray() - { - - } + public Collider[] colliders; + public List attackColliders1 = new List(); /// /// 搜索范围内的无人机 /// @@ -380,16 +374,26 @@ public class Spectrumdetection : MonoBehaviour UnmannedAerialVehicle unmannedAerialVehicle = null; if (colliders[i].GetComponent()) { + attackColliders1.Add(colliders[i]); unmannedAerialVehicle = colliders[i].GetComponent(); if (unmannedAerialVehicle != null&& unmannedAerialVehicle.unmannedAerialVehicleManage.dataLinkCommunicationFrequency== Frequency) { Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false)); + + LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0)); if (microwaveweapon) { microwaveweapon.ismicow = true; microwaveweapon.miceopos = unmannedAerialVehicle.transform; microwaveweapon.Orientation(); } + else if (laserFireControlPlatformManger) + { + laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime; + laserFireControlPlatformManger.isLasing = true; + laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform; + laserFireControlPlatformManger.Lasing(); + } } } diff --git a/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs b/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs index 29fcc18c..a8611134 100644 --- a/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs +++ b/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs @@ -290,12 +290,15 @@ public class RadarManger : MonoBehaviour } } + public List colliders = new List(); + + public List attackColliders1 = new List(); /// /// 检索 /// public void RetrievalUAV() { - List colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体 + colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体 var colliders2 = colliders.FindAll(x => x.tag == "WRJ"); minCamera.orthographicSize = detectionRadius; if (colliders2.Count > 0) @@ -305,7 +308,9 @@ public class RadarManger : MonoBehaviour UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent(); if (unmannedAerialVehicle) { - LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0)); + attackColliders1.Add(colliders[i]); + LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0)); + Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false)); if (laserFireControlPlatformManger) { laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime; @@ -313,6 +318,12 @@ public class RadarManger : MonoBehaviour laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform; laserFireControlPlatformManger.Lasing(); } + else if (microwaveweapon) + { + microwaveweapon.ismicow = true; + microwaveweapon.miceopos = unmannedAerialVehicle.transform; + microwaveweapon.Orientation(); + } } } } diff --git a/Assets/Zion/Scripts/WRJ0125/DroneViewDisplay.cs b/Assets/Zion/Scripts/WRJ0125/DroneViewDisplay.cs index cbb73c5c..2423b029 100644 --- a/Assets/Zion/Scripts/WRJ0125/DroneViewDisplay.cs +++ b/Assets/Zion/Scripts/WRJ0125/DroneViewDisplay.cs @@ -143,7 +143,7 @@ public class DroneViewDisplay : MonoSingleton public void DistroyUI(string deviceID) { if(deviceID.Length < 10) return; - RadioAngleView radioAngleView = radioAngleViews.Find(x => x.deviceID == deviceID); + RadioAngleView radioAngleView = radioAngleViews.Find(x => x != null && x.deviceID == deviceID); if (radioAngleView) { Destroy(radioAngleView.gameObject); @@ -155,9 +155,10 @@ public class DroneViewDisplay : MonoSingleton } } } - RenderTexture renderTexture = renderTextures.Find(x => x.name.Contains(deviceID)); + RenderTexture renderTexture = renderTextures.Find(x => x != null && x.name.Contains(deviceID)); if (renderTexture) { + Debug.Log("删除了" + renderTexture.name); Destroy(renderTexture); for (int i = 0; i < renderTextures.Count; i++) {