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