This commit is contained in:
parent
db6a8584e1
commit
32798355eb
|
@ -141,14 +141,14 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5224973007127515503}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -491.42, y: 160.04, z: -89.7}
|
||||
m_LocalScale: {x: 18, y: 18, z: 18}
|
||||
m_Children:
|
||||
- {fileID: 4159137828818466878}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2669641987923470564
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -165,6 +165,7 @@ MonoBehaviour:
|
|||
selectedSide: 1
|
||||
equipmentType: "\u5730\u9762\u65E0\u7EBF\u7535\u5E72\u6270"
|
||||
deviceID:
|
||||
ISPlayer: 0
|
||||
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
||||
type: 3}
|
||||
isMove: 1
|
||||
|
@ -205,8 +206,8 @@ BoxCollider:
|
|||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.42351785, y: 0.4418318, z: 0.49796286}
|
||||
m_Center: {x: 0.009579976, y: -0.0021133423, z: -0.25554445}
|
||||
m_Size: {x: 0.42351785, y: 0.5147799, z: 0.42257693}
|
||||
m_Center: {x: 0.009579976, y: 0.2519765, z: -0.0063182847}
|
||||
--- !u!54 &4108524336644022763
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -234,8 +235,8 @@ BoxCollider:
|
|||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.42351785, y: 0.4418318, z: 0.49796286}
|
||||
m_Center: {x: 0.009579976, y: -0.0021133423, z: -0.25554445}
|
||||
m_Size: {x: 0.42351785, y: 0.5147799, z: 0.41892996}
|
||||
m_Center: {x: 0.009579976, y: 0.2519765, z: -0.006926146}
|
||||
--- !u!1001 &2003813850601294501
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -246,22 +247,22 @@ PrefabInstance:
|
|||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
value: 0.3713
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -0.369
|
||||
value: -0.014
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 1
|
||||
value: -0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
|
@ -276,7 +277,7 @@ PrefabInstance:
|
|||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
|
@ -286,7 +287,7 @@ PrefabInstance:
|
|||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 180
|
||||
value: -90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: d14c6397f108bf64b96946deb44c3369,
|
||||
type: 3}
|
||||
|
|
|
@ -64,6 +64,7 @@ public class Spectrumdetection : MonoBehaviour
|
|||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
}
|
||||
/// <summary>
|
||||
/// 演习是否启动
|
||||
|
|
|
@ -31,14 +31,18 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
|||
// 布尔值变化时触发的事件
|
||||
public event System.Action<bool> OnActivationChanged;
|
||||
|
||||
public void OnInit()
|
||||
{
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
|
||||
SyncCreateRoom.send2roomRequset += GetSend2roomMsg;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
SyncCreateRoom.send2roomRequset += GetSend2roomMsg;
|
||||
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -157,6 +157,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
|
||||
tenkokuModule.mainCamera = spt.transform;
|
||||
AddPlayers(spt);
|
||||
DeviceManager.Instance.OnInit();
|
||||
DeviceManager.Instance.isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,12 @@ public class EquipmentCommon : MonoBehaviour
|
|||
//
|
||||
OnActivationIsPlayer += OnActivationChangedIsPlayer;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
_isStartRehearsing= GlobalFlag.isStartRehearsing;
|
||||
}
|
||||
|
||||
|
||||
void OnActivationChangedIsPlayer(bool newValue)
|
||||
{
|
||||
if (newValue && equipmentType == "蜂群无人机")
|
||||
|
|
|
@ -10,7 +10,17 @@ using System;
|
|||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using Random = UnityEngine.Random;
|
||||
using static UnityEngine.GraphicsBuffer;
|
||||
|
||||
/*
|
||||
地面无线电干扰对无人机的干扰通常是指对其数据链通信频点的干扰,而不是卫星定位频点的干扰。
|
||||
|
||||
无人机通常通过数据链与地面控制站进行通信,用于传输指令、图像、视频等数据。这些数据链通信频点通常在特定频段内使用,例如2.4GHz或5.8GHz等。地面无线电干扰可能会在这些频点上发射无关信号,导致无人机与地面控制站之间的通信受到干扰。
|
||||
|
||||
卫星定位频点(如GPS)通常用于无人机的导航和定位。地面无线电干扰通常不会直接干扰到这些卫星定位频点,因为这些频点由卫星系统控制并具有较高的抗干扰能力。然而,如果地面无线电干扰源的信号干扰范围广泛,可能会产生杂散信号,从而影响无人机的GPS接收机的性能。
|
||||
|
||||
需要注意的是,针对无人机的干扰行为是非法且危险的,违反了无人机的安全运行规定。在使用无人机或遇到无人机干扰时,应当及时报告相关部门并采取相应的措施。
|
||||
*/
|
||||
/// <summary>
|
||||
/// 地面无线电干扰控制
|
||||
/// </summary>
|
||||
|
@ -93,13 +103,15 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
/// 地面的图层
|
||||
/// </summary>
|
||||
public LayerMask ground;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
|
||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
@ -150,7 +162,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
/// 导条变化调用
|
||||
/// </summary>
|
||||
/// <param name="newValue"></param>
|
||||
void OnActivationChangedHandler(bool newValue)
|
||||
public void OnActivationChangedHandler(bool newValue)
|
||||
{
|
||||
if (newValue)
|
||||
{
|
||||
|
@ -301,17 +313,13 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
/// </summary>
|
||||
public void Interferencemode(Transform wrj)
|
||||
{
|
||||
//Collider[] colliders = Physics.OverlapSphere(transform.position, detectionRadius * 100);//检索范围
|
||||
//UnmannedAerialVehicle unmannedAerialVehicle = null;
|
||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = null;
|
||||
//if (wrj.GetComponent<UnmannedAerialVehicle>())
|
||||
//{
|
||||
// unmannedAerialVehicle = wrj.GetComponent<UnmannedAerialVehicle>();
|
||||
//}
|
||||
if (wrj.GetComponent<UnmannedAerialVehicleManage>())
|
||||
{
|
||||
unmannedAerialVehicleManage = wrj.GetComponent<UnmannedAerialVehicleManage>();
|
||||
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
|
||||
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(
|
||||
InterferenceMode,
|
||||
ground);
|
||||
}
|
||||
isDo = true;
|
||||
}
|
||||
|
@ -335,24 +343,37 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
{
|
||||
//Debug.Log(col.name+"数据链通信频点...:" + unmannedAerialVehicle.dataLinkCommunicationFrequency);
|
||||
if (unmannedAerialVehicleManage.dataLinkCommunicationFrequency == "" || InterferingFrequency == "") continue;//无数据不执行
|
||||
if (unmannedAerialVehicleManage.dataLinkCommunicationFrequency == InterferingFrequency)
|
||||
//if (unmannedAerialVehicleManage.dataLinkCommunicationFrequency == InterferingFrequency)
|
||||
if (unmannedAerialVehicleManage.satellitePositioningFrequency == InterferingFrequency)
|
||||
{
|
||||
Debug.Log("干扰...:" + colliders[i].name + "成功。");
|
||||
//unmannedAerialVehicle.BeAssaulted("无线电干扰");
|
||||
Vector3 one = unmannedAerialVehicleManage.transform.position - transform.position;
|
||||
float angue = Vector3.Angle(one, transform.forward);
|
||||
if (float.Parse(InterferenceAngle) >= angue)
|
||||
{
|
||||
WRJs.Enqueue(unmannedAerialVehicleManage.transform);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (unmannedAerialVehicle)
|
||||
{
|
||||
//Debug.Log(col.name+"数据链通信频点...:" + unmannedAerialVehicle.dataLinkCommunicationFrequency);
|
||||
if (unmannedAerialVehicle.dataLinkCommunicationFrequency == "" || InterferingFrequency == "") continue;//无数据不执行
|
||||
if (unmannedAerialVehicle.dataLinkCommunicationFrequency == InterferingFrequency)
|
||||
//if (unmannedAerialVehicle.dataLinkCommunicationFrequency == InterferingFrequency)
|
||||
if (unmannedAerialVehicle.satellitePositioningFrequency == InterferingFrequency)
|
||||
{
|
||||
Debug.Log("干扰...:" + colliders[i].name + "成功。");
|
||||
//unmannedAerialVehicle.BeAssaulted("无线电干扰");
|
||||
Vector3 one = unmannedAerialVehicle.transform.position - transform.position;
|
||||
float angue = Vector3.Angle(one, transform.forward);
|
||||
if (float.Parse(InterferenceAngle) >= angue)
|
||||
{
|
||||
WRJs.Enqueue(unmannedAerialVehicle.transform);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -537,14 +537,17 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
/// <summary>
|
||||
/// 检测无线电频率
|
||||
/// </summary>
|
||||
/// <param name="interferingFrequency">无线电数据</param>
|
||||
/// <param name="interferenceMode">驱离或者迫降</param>
|
||||
public void CheckSatellitePositioningFrequency(Transform target, string interferenceMode, string transmittedPower, string interferingFrequency, string interferenceAngle, LayerMask ground)
|
||||
{
|
||||
if (transmittedPower == "10~30W" || transmittedPower == "30~50W")
|
||||
{
|
||||
if (satellitePositioningFrequency == interferingFrequency)
|
||||
/// <param name="target">无线电</param>
|
||||
/// <param name="interferenceMode">干扰模式</param>
|
||||
/// <param name="transmittedPower">发射功率</param>
|
||||
/// <param name="interferingFrequency">干扰频率</param>
|
||||
/// <param name="interferenceAngle">干扰角度</param>
|
||||
/// <param name="ground">地面的图层</param>
|
||||
public void CheckSatellitePositioningFrequency(
|
||||
string interferenceMode,
|
||||
LayerMask ground)
|
||||
{
|
||||
|
||||
if (interferenceMode == "驱离")
|
||||
{
|
||||
transform.DOKill();
|
||||
|
@ -565,21 +568,6 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (transmittedPower == "50~100W")
|
||||
{
|
||||
if (dataLinkCommunicationFrequency == interferingFrequency)
|
||||
{
|
||||
Vector3 one = transform.position - target.transform.position;
|
||||
float angue = Vector3.Angle(one, target.transform.forward);
|
||||
if (float.Parse(interferenceAngle) >= angue)
|
||||
{
|
||||
maximumFlyingSpeed = (float.Parse(maximumFlyingSpeed) - 5).ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue