From 892259e6c747d12a920ec94db31d4c2c049c0fc2 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Fri, 22 Mar 2024 12:54:50 +0800 Subject: [PATCH 1/3] 22 --- .../ModelFunction/Radar/RadarManger.cs | 208 +++++++++++------- 1 file changed, 130 insertions(+), 78 deletions(-) diff --git a/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs b/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs index e5beb48c..1c7e359a 100644 --- a/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs +++ b/Assets/Zion/Scripts/ModelFunction/Radar/RadarManger.cs @@ -165,7 +165,7 @@ public class RadarManger : MonoBehaviour if (isStartRehearsing) { minCamera.gameObject.SetActive(true); - targets = GameObject.FindGameObjectsWithTag("WRJ").ToList().FindAll(a => a.GetComponent().GetRCS() > rcs); + targets = GameObject.FindGameObjectsWithTag("WRJ").ToList().FindAll(GetQualifiedEquipment); foreach (Transform child in rawImage.transform) { @@ -187,30 +187,14 @@ public class RadarManger : MonoBehaviour // onlyOne = false; // DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage); //} - Deadzone();//雷达盲区 + //Deadzone();//雷达盲区 //if (Mapsize >1) //{ // Dotsize();//改变雷达地图上显示无人机大小 //} } - private void Dotsize() - { - GameObject[] wrjdtdx = GameObject.FindGameObjectsWithTag("WRJ"); - for (int i = 0; i < wrjdtdx.Length; i++) - { - if (wrjdtdx[i].gameObject.tag == "WRJ" && equipmentCommon.isPlayer) - { - UnmannedAerialVehicleManage unmannedAerialVehicleManage = wrjdtdx[i].GetComponent(); - if (unmannedAerialVehicleManage && unmannedAerialVehicleManage.gamemap) - { - unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize, 1, Mapsize); - //Debug.Log("改变了无人机显示大小"); - } - } - } - - } + #region 启动暂停 @@ -270,13 +254,6 @@ public class RadarManger : MonoBehaviour } #endregion - void CreateRadarUI() - { - imageprs.transform.localScale = Vector3.zero; - aniRandarUI = imageprs.GetComponent(); - RadarRotationSpeed(TurntableSpeed); - } - /// /// 数据写入 /// @@ -289,11 +266,11 @@ public class RadarManger : MonoBehaviour { case "转台转速:": TurntableSpeed = weaponitemone[i].para_value; - //RadarRotationSpeed(TurntableSpeed); + RadarRotationSpeed(TurntableSpeed); break; case "探测距离:": DetectionRange = weaponitemone[i].para_value; - Showmap(float.Parse(DetectionRange)); + //Showmap(float.Parse(DetectionRange)); detectionRadius = float.Parse(DetectionRange) * 1000; minCamera.orthographicSize = detectionRadius; break; @@ -330,29 +307,7 @@ public class RadarManger : MonoBehaviour } } - private void Showmap(float size) - { - switch (size) - { - case 1: - Mapsize = 30; - break; - case 2: - Mapsize = 60; - break; - case 3: - Mapsize = 90; - break; - case 4: - Mapsize = 120; - break; - case 5: - Mapsize = 150; - break; - default: - break; - } - } + /// /// 雷达转动速度 @@ -371,28 +326,21 @@ public class RadarManger : MonoBehaviour } } - public List colliders = new List(); - - public List attackColliders1 = new List(); /// /// 检索 /// public void RetrievalUAV() { - colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体 - var colliders2 = colliders.FindAll(x => x.tag == "WRJ"); - - if (colliders2.Count > 0) + if (targets.Count > 0) { - for (int i = 0; i < colliders2.Count; i++) + for (int i = 0; i < targets.Count; i++) { - UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent(); + UnmannedAerialVehicle unmannedAerialVehicle = targets[i].GetComponent(); if (unmannedAerialVehicle) { bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea; if (!isnearBlindArea) continue; - 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) @@ -412,28 +360,132 @@ public class RadarManger : MonoBehaviour } } } + + #region 备份 + // public List colliders = new List(); + // public List attackColliders1 = new List(); + //public void RetrievalUAV() + //{ + // colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体 + // var colliders2 = colliders.FindAll(x => x.tag == "WRJ"); + + // if (colliders2.Count > 0) + // { + // for (int i = 0; i < colliders2.Count; i++) + // { + // UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent(); + // if (unmannedAerialVehicle) + // { + // bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea; + // if (!isnearBlindArea) + // continue; + // 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 + 1.5f; + // laserFireControlPlatformManger.isLasing = true; + // laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform; + // laserFireControlPlatformManger.Lasing(); + // } + // else if (microwaveweapon) + // { + // microwaveweapon.ismicow = true; + // microwaveweapon.miceopos = unmannedAerialVehicle.transform; + // microwaveweapon.Orientation(); + // } + // } + // } + // } + //} + + //private void Showmap(float size) + //{ + // switch (size) + // { + // case 1: + // Mapsize = 30; + // break; + // case 2: + // Mapsize = 60; + // break; + // case 3: + // Mapsize = 90; + // break; + // case 4: + // Mapsize = 120; + // break; + // case 5: + // Mapsize = 150; + // break; + // default: + // break; + // } + //} + + //void CreateRadarUI() + //{ + // imageprs.transform.localScale = Vector3.zero; + // aniRandarUI = imageprs.GetComponent(); + // RadarRotationSpeed(TurntableSpeed); + //} + + //private void Dotsize() + //{ + // GameObject[] wrjdtdx = GameObject.FindGameObjectsWithTag("WRJ"); + // for (int i = 0; i < wrjdtdx.Length; i++) + // { + // if (wrjdtdx[i].gameObject.tag == "WRJ" && equipmentCommon.isPlayer) + // { + // UnmannedAerialVehicleManage unmannedAerialVehicleManage = wrjdtdx[i].GetComponent(); + // if (unmannedAerialVehicleManage && unmannedAerialVehicleManage.gamemap) + // { + // unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize, 1, Mapsize); + // //Debug.Log("改变了无人机显示大小"); + // } + // } + // } + + //} + /// /// 雷达盲区让目标消失在地图上 /// - private void Deadzone() + //private void Deadzone() + //{ + // if (float.Parse(NearBlindArea) > 0) + // { + // Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(NearBlindArea)); + // for (int i = 0; i < colliders.Length; i++) + // { + // if (colliders[i].transform.gameObject.tag == "WRJ") + // { + // //Debug.Log("进来了" + Vector3.Distance(transform.position, colliders[i].transform.position)); + // UnmannedAerialVehicleManage unmannedAerialVehicle = colliders[i].GetComponent(); + // if (unmannedAerialVehicle) + // { + // unmannedAerialVehicle.gamemap.SetActive(false); + // } + // } + // } + // } + //} + #endregion + + /// + /// 获取符合条件的设备 + /// + public bool GetQualifiedEquipment(GameObject obj) { - if (float.Parse(NearBlindArea) > 0) - { - Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(NearBlindArea)); - for (int i = 0; i < colliders.Length; i++) - { - if (colliders[i].transform.gameObject.tag == "WRJ") - { - //Debug.Log("进来了" + Vector3.Distance(transform.position, colliders[i].transform.position)); - UnmannedAerialVehicleManage unmannedAerialVehicle = colliders[i].GetComponent(); - if (unmannedAerialVehicle) - { - unmannedAerialVehicle.gamemap.SetActive(false); - } - } - } - } + if(obj.GetComponent() + && obj.GetComponent().GetRCS() > rcs + && Vector3.Distance(transform.position,obj.transform.position)> float.Parse(NearBlindArea)) + return true; + else + return false; } + /// /// 检测鼠标点击的方法 From ee2cc737af288f46a56fa4498f1271aab4e5dbb4 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Fri, 22 Mar 2024 13:02:18 +0800 Subject: [PATCH 2/3] 2223 --- .../UAV/UnmannedAerialVehicleManage.cs | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index a8e61d15..226cf8e0 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -826,38 +826,38 @@ public class UnmannedAerialVehicleManage : MonoBehaviour /// /// 雷达检测无人机身上得RSC /// - public void CheckRSC() - { - if (string.IsNullOrEmpty(RCS)) - { - float rcs = float.Parse(RCS); - if (rcs <= 0.5 && rcs >= 0.1) - { - StartCoroutine(ShowRadarTips(0.8f, 2)); - } - else if (rcs >= 0.5f && rcs <= 1) - { - StartCoroutine(ShowRadarTips(0.4f, 1)); - } - } - } + //public void CheckRSC() + //{ + // if (string.IsNullOrEmpty(RCS)) + // { + // float rcs = float.Parse(RCS); + // if (rcs <= 0.5 && rcs >= 0.1) + // { + // StartCoroutine(ShowRadarTips(0.8f, 2)); + // } + // else if (rcs >= 0.5f && rcs <= 1) + // { + // StartCoroutine(ShowRadarTips(0.4f, 1)); + // } + // } + //} /// /// 多少时间在对方雷达界面上显示红色标记 /// /// /// /// - private IEnumerator ShowRadarTips(float minTime, float maxTime) - { - GameObject tips = transform.Find("Minimapwrj").gameObject; - while (true) - { - tips.gameObject.SetActive(false); - float time = UnityEngine.Random.Range(minTime, maxTime); - yield return new WaitForSeconds(time); - tips.gameObject.SetActive(true); - } - } + //private IEnumerator ShowRadarTips(float minTime, float maxTime) + //{ + // GameObject tips = transform.Find("Minimapwrj").gameObject; + // while (true) + // { + // tips.gameObject.SetActive(false); + // float time = UnityEngine.Random.Range(minTime, maxTime); + // yield return new WaitForSeconds(time); + // tips.gameObject.SetActive(true); + // } + //} public LayerMask layerMask = new LayerMask(); /// @@ -1230,7 +1230,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour unmannedAerialVehicleManages.RemoveAt(i); } } - StopCoroutine(ShowRadarTips(0, 0)); + //StopCoroutine(ShowRadarTips(0, 0)); OnActivationChanged -= OnActivationChangedHandler; } From c2e0f2472650e59c1870bbfb14554864974ec555 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Fri, 22 Mar 2024 14:47:54 +0800 Subject: [PATCH 3/3] 3232 --- .../Prefebs/Models/moder/无人机List.prefab | 64 +++++++++--------- .../UAV/UnmannedAerialVehicleManage.cs | 65 ++++++++++--------- 2 files changed, 63 insertions(+), 66 deletions(-) diff --git a/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab b/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab index 0d518c02..da185e72 100644 --- a/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab +++ b/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab @@ -1626,8 +1626,6 @@ MonoBehaviour: SurveillanceFrequencyBand: {fileID: 8129871292636694301} flySpeedPlane: {fileID: 9020723963205404446} flySpeedSlider: {fileID: 608716198515631330} - gamePos: {fileID: 3441049289142467652} - gamemap: {fileID: 9017854076308260405} reveal: 0 Ground: serializedVersion: 2 @@ -2798,14 +2796,13 @@ PrefabInstance: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3} ---- !u!1 &9017854076308260405 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de, - type: 3} - m_PrefabInstance: {fileID: 638589549675547561} - m_PrefabAsset: {fileID: 0} --- !u!4 &5172610439169658982 stripped Transform: m_CorrespondingSourceObject: {fileID: 5698306997877693391, guid: 91b685a7f0a6f7643b8ae61842f883de, @@ -3067,6 +3064,11 @@ PrefabInstance: propertyPath: m_Layer value: 16 objectReference: {fileID: 0} + - target: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3} --- !u!4 &1525602421726030359 stripped @@ -3075,12 +3077,6 @@ Transform: type: 3} m_PrefabInstance: {fileID: 6501072882878902744} m_PrefabAsset: {fileID: 0} ---- !u!1 &3441049289142467652 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de, - type: 3} - m_PrefabInstance: {fileID: 6501072882878902744} - m_PrefabAsset: {fileID: 0} --- !u!1001 &6738463286047272674 PrefabInstance: m_ObjectHideFlags: 0 @@ -3542,9 +3538,9 @@ PrefabInstance: - {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} - {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} ---- !u!114 &1189649587738053663 stripped +--- !u!114 &7739009189435305960 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b, + m_CorrespondingSourceObject: {fileID: 3955760755921223946, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_PrefabInstance: {fileID: 6738463286047272674} m_PrefabAsset: {fileID: 0} @@ -3566,9 +3562,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &805817557573538235 stripped +--- !u!114 &6599785080451423720 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6245650889842523993, guid: 38fb1def99b2cd147a96842efe5a355b, + m_CorrespondingSourceObject: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_PrefabInstance: {fileID: 6738463286047272674} m_PrefabAsset: {fileID: 0} @@ -3596,9 +3592,9 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 6738463286047272674} m_PrefabAsset: {fileID: 0} ---- !u!114 &6599785080451423720 stripped +--- !u!114 &1189649587738053663 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b, + m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_PrefabInstance: {fileID: 6738463286047272674} m_PrefabAsset: {fileID: 0} @@ -3632,9 +3628,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &7739009189435305960 stripped +--- !u!114 &805817557573538235 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 3955760755921223946, guid: 38fb1def99b2cd147a96842efe5a355b, + m_CorrespondingSourceObject: {fileID: 6245650889842523993, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_PrefabInstance: {fileID: 6738463286047272674} m_PrefabAsset: {fileID: 0} @@ -4100,6 +4096,18 @@ PrefabInstance: - {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} - {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3} +--- !u!114 &3114167497287670592 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b, + type: 3} + m_PrefabInstance: {fileID: 7365093489755617725} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &8959769708417747035 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 1900922108148937190, guid: 38fb1def99b2cd147a96842efe5a355b, @@ -4190,15 +4198,3 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 7365093489755617725} m_PrefabAsset: {fileID: 0} ---- !u!114 &3114167497287670592 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b, - type: 3} - m_PrefabInstance: {fileID: 7365093489755617725} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} - m_Name: - m_EditorClassIdentifier: diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index 226cf8e0..3df0d1f2 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -184,14 +184,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour /// public ExtendedSlider flySpeedSlider; - /// - /// 显示频谱地图上的位置 - /// - public GameObject gamePos; - /// - /// 显示在雷达上的位置 - /// - public GameObject gamemap; + ///// + ///// 显示频谱地图上的位置 + ///// + //public GameObject gamePos; + ///// + ///// 显示在雷达上的位置 + ///// + //public GameObject gamemap; /// /// 频谱显示无人机大小 /// @@ -206,7 +206,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour public bool boisp = true; void Start() { - gamePos.gameObject.SetActive(false); + //gamePos.gameObject.SetActive(false); MatrixFormation(30, 1); for (int i = 0; i < unmannedAerialVehicles.Count; i++) { @@ -231,14 +231,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour flySpeedSlider.DragStop.AddListener(ChanagerFlySpeed); } - private void Mapdisplay() - { - if (reveal > 1) - { - gamePos.transform.localScale = new Vector3(reveal, 1, reveal); - boisp = false; - } - } + //private void Mapdisplay() + //{ + // if (reveal > 1) + // { + // gamePos.transform.localScale = new Vector3(reveal, 1, reveal); + // boisp = false; + // } + //} /// /// 设置组得标志 @@ -277,7 +277,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour { dataLinkCommunicationFrequency = change.transform.name; int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency); - gamePos.layer = layerValue; + //gamePos.layer = layerValue; string nowData = GetSyncDataTwo(); MyNetMQClient.instance.Send(nowData); equipmentCommon.SetDatabaseInfo("my_rate", dataLinkCommunicationFrequency); @@ -325,7 +325,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour { int layerValue = LayerMask.NameToLayer(_frequency); dataLinkCommunicationFrequency = _frequency; - gamePos.layer = layerValue; + //gamePos.layer = layerValue; } /// /// 接受同步消息 @@ -348,10 +348,10 @@ public class UnmannedAerialVehicleManage : MonoBehaviour { Rotation_Angle.transform.Rotate(Vector3.up*10*Time.deltaTime); } - if (isStartRehearsing) - { - gamePos.gameObject.SetActive(true); - } + //if (isStartRehearsing) + //{ + // //gamePos.gameObject.SetActive(true); + //} if (isStartRehearsing && equipmentCommon.isPlayer) { switch (pattern) @@ -395,23 +395,23 @@ public class UnmannedAerialVehicleManage : MonoBehaviour { case 1: reveal = 30; - Mapdisplay(); + //Mapdisplay(); break; case 2: reveal = 60; - Mapdisplay(); + //Mapdisplay(); break; case 3: reveal = 90; - Mapdisplay(); + //Mapdisplay(); break; case 4: reveal = 120; - Mapdisplay(); + //Mapdisplay(); break; case 5: reveal = 150; - Mapdisplay(); + //Mapdisplay(); break; default: break; @@ -509,6 +509,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour && allColliders[i].transform.GetComponent() && allColliders[i].transform.GetComponent().frequency == electronicReconnaissanceCapability) { + attackColliders1.Add(allColliders[i]); } @@ -698,8 +699,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour togFrequencyBands[k].gameObject.SetActive(date1.Contains(togFrequencyBands[k].transform.name)); } dataLinkCommunicationFrequency = dates1[0]; - int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency); - gamePos.layer = layerValue; + //int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency); + //gamePos.layer = layerValue; foreach (Toggle toggle in togFrequencyBands) { if (toggle.transform.name == dataLinkCommunicationFrequency) @@ -1162,7 +1163,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour if (isMove && positions.Count > 0) { isMove = false; - gamePos.gameObject.SetActive(true); + //gamePos.gameObject.SetActive(true); //gamemap.gameObject.SetActive(true); Vector3 _positions = positions.Dequeue(); var nowData = GetSyncData(_positions); @@ -1180,7 +1181,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour /// public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体 { - gamePos.gameObject.SetActive(true); + //gamePos.gameObject.SetActive(true); //gamemap.gameObject.SetActive(true); Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标 float _distance = Vector3.Distance(transform.position, targetPosition);