This commit is contained in:
yulong 2024-01-27 15:36:05 +08:00
parent 1adc3fba33
commit c306533ca1
3 changed files with 22 additions and 9 deletions

View File

@ -833,6 +833,8 @@ MonoBehaviour:
toggle5: {fileID: 5382943705491709219} toggle5: {fileID: 5382943705491709219}
toggle6: {fileID: 6251437642903478223} toggle6: {fileID: 6251437642903478223}
toggle7: {fileID: 117463751223528660} toggle7: {fileID: 117463751223528660}
Frequency:
camera: {fileID: 480111845}
--- !u!65 &1537869982341012852 --- !u!65 &1537869982341012852
BoxCollider: BoxCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -81,7 +81,10 @@ public class Spectrumdetection : MonoBehaviour
/// 最终的波段 /// 最终的波段
/// </summary> /// </summary>
public string Frequency; public string Frequency;
/// <summary>
/// 摄像机显示层数
/// </summary>
public Camera camera;
void Start() void Start()
{ {
equipmentCommon = GetComponent<EquipmentCommon>(); equipmentCommon = GetComponent<EquipmentCommon>();
@ -102,6 +105,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "HUF"; Frequency = "HUF";
camera.cullingMask = 1 << 16;
} }
}); });
toggle2.onValueChanged.AddListener((ison) => toggle2.onValueChanged.AddListener((ison) =>
@ -109,6 +113,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "L"; Frequency = "L";
camera.cullingMask = 1 << 17;
} }
}); });
toggle3.onValueChanged.AddListener((ison) => toggle3.onValueChanged.AddListener((ison) =>
@ -116,6 +121,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "S"; Frequency = "S";
camera.cullingMask = 1 << 18;
} }
}); });
toggle4.onValueChanged.AddListener((ison) => toggle4.onValueChanged.AddListener((ison) =>
@ -123,6 +129,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "C"; Frequency = "C";
camera.cullingMask = 1 << 19;
} }
}); });
toggle5.onValueChanged.AddListener((ison) => toggle5.onValueChanged.AddListener((ison) =>
@ -130,6 +137,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "X"; Frequency = "X";
camera.cullingMask = 1 << 20;
} }
}); });
toggle6.onValueChanged.AddListener((ison) => toggle6.onValueChanged.AddListener((ison) =>
@ -137,6 +145,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "Ku"; Frequency = "Ku";
camera.cullingMask = 1 << 21;
} }
}); });
toggle7.onValueChanged.AddListener((ison) => toggle7.onValueChanged.AddListener((ison) =>
@ -144,6 +153,7 @@ public class Spectrumdetection : MonoBehaviour
if (ison) if (ison)
{ {
Frequency = "Ka"; Frequency = "Ka";
camera.cullingMask = (1 << 22);
} }
}); });
} }
@ -235,7 +245,7 @@ public class Spectrumdetection : MonoBehaviour
private void Microwavefrequency() private void Microwavefrequency()
{ {
if (frequency.Length>0) if (frequency.Length > 0)
{ {
string[] str = frequency.Split(','); string[] str = frequency.Split(',');
for (int i = 0; i < str.Length; i++) for (int i = 0; i < str.Length; i++)
@ -247,7 +257,7 @@ public class Spectrumdetection : MonoBehaviour
break; break;
case "L": case "L":
toggle2.gameObject.SetActive(true); toggle2.gameObject.SetActive(true);
break ; break;
case "S": case "S":
toggle3.gameObject.SetActive(true); toggle3.gameObject.SetActive(true);
break; break;
@ -281,7 +291,7 @@ public class Spectrumdetection : MonoBehaviour
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
private void Emittedray() private void Emittedray()
{ {
if (Input.GetMouseButtonDown(0)&& UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0") if (Input.GetMouseButtonDown(0) && UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0")
{ {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit; RaycastHit hit;
@ -289,7 +299,7 @@ public class Spectrumdetection : MonoBehaviour
{ {
return; return;
} }
if (Physics.Raycast(ray,out hit,1000)) if (Physics.Raycast(ray, out hit, 1000))
{ {
if (hit.collider.GetComponent<EquipmentCommon>()) if (hit.collider.GetComponent<EquipmentCommon>())
{ {
@ -312,25 +322,25 @@ public class Spectrumdetection : MonoBehaviour
Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(Detectionrange) * 100); Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(Detectionrange) * 100);
for (int i = 0; i < colliders.Length; i++) for (int i = 0; i < colliders.Length; i++)
{ {
if (colliders[i].transform.gameObject.tag=="WRJ") if (colliders[i].transform.gameObject.tag == "WRJ")
{ {
Debug.LogError("进来了"); Debug.LogError("进来了");
UnmannedAerialVehicle unmannedAerialVehicle = null; UnmannedAerialVehicle unmannedAerialVehicle = null;
if (colliders[i].GetComponent<UnmannedAerialVehicle>()) if (colliders[i].GetComponent<UnmannedAerialVehicle>())
{ {
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>(); unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
if (unmannedAerialVehicle !=null) if (unmannedAerialVehicle != null)
{ {
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false)); Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => (x != null && x.ismicow == false));
if (microwaveweapon) if (microwaveweapon)
{ {
microwaveweapon.ismicow = true; microwaveweapon.ismicow = true;
microwaveweapon.miceopos = unmannedAerialVehicle.transform; microwaveweapon.miceopos = unmannedAerialVehicle.transform;
microwaveweapon.Orientation(); microwaveweapon.Orientation();
} }
} }
} }
} }
} }
} }

View File

@ -140,6 +140,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
if (ison) if (ison)
{ {
disturb = "HUF"; disturb = "HUF";
} }
}); });
toggle2.onValueChanged.AddListener((ison) => toggle2.onValueChanged.AddListener((ison) =>