This commit is contained in:
parent
30f13a8e8e
commit
71f609d599
|
@ -316,12 +316,11 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
if (colliders[i].GetComponent<UnmannedAerialVehicleManage>())
|
||||
{
|
||||
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||
}
|
||||
|
||||
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 干扰无人机角度范围
|
||||
/// </summary>
|
||||
|
|
|
@ -99,32 +99,7 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
|||
/// <param name="type"></param>
|
||||
public void BeAssaulted(string type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
//case "激光打击":
|
||||
// AddBao(true);
|
||||
// //Debug.Log(transform.name+"被激光打击销毁了");
|
||||
// break;
|
||||
//case "无线电干扰":
|
||||
// Vector3 _pos = transform.position - new Vector3(0, 30, 0);
|
||||
// transform.LookAt(_pos);
|
||||
// transform.DOMove(_pos, 1).OnComplete(() =>
|
||||
// {
|
||||
// AddBao(true);
|
||||
// });
|
||||
// //Debug.Log(transform.name + "无人机被无线电干扰销毁了");
|
||||
// break;
|
||||
case "攻击到目标":
|
||||
AddBao(true);
|
||||
//Debug.Log(transform.name + "无人机自杀式攻击销毁了");
|
||||
break;
|
||||
case "没有攻击到目标":
|
||||
AddBao(true);
|
||||
//Debug.Log(transform.name + "无人机自杀式没有攻击到目标撞击地面销毁了");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -224,17 +199,17 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
|||
{
|
||||
transform.DOKill();
|
||||
attackTarget = target;
|
||||
Debug.Log("开始攻击目标..:" + target.name);
|
||||
Vector3 _v3 = target.position;
|
||||
Debug.Log("开始攻击目标..:" + attackTarget.name);
|
||||
Vector3 _v3 = attackTarget.position;
|
||||
transform.DOLookAt(_v3, 0.1f).OnComplete(() =>
|
||||
{
|
||||
float distance = Vector3.Distance(transform.position, target.position);
|
||||
transform.DOMove(target.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() =>
|
||||
float distance = Vector3.Distance(transform.position, attackTarget.position);
|
||||
transform.DOMove(attackTarget.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() =>
|
||||
{
|
||||
if (!target)
|
||||
{
|
||||
BeAssaulted("没有攻击到目标");
|
||||
}
|
||||
//if (!attackTarget)
|
||||
//{
|
||||
// //BeAssaulted("没有攻击到目标");
|
||||
//}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -290,14 +290,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
{
|
||||
if (attackColliders1.Count > 0)
|
||||
{
|
||||
//isEngagedTarget = true;
|
||||
//colliders1.ForEach(x => Debug.Log(x.transform.name));
|
||||
int _number = UnityEngine.Random.Range(0, attackColliders1.Count - 1);
|
||||
List<UnmannedAerialVehicle> _unmannedAerialVehicles = unmannedAerialVehicles.FindAll(x => x != null && x.gameObject.activeSelf);
|
||||
SendMsg(attackColliders1[_number].transform);
|
||||
for (int i = 0; i < _unmannedAerialVehicles.Count; i++)
|
||||
{
|
||||
_unmannedAerialVehicles[i].AttAck(attackColliders1[_number].transform);
|
||||
if (_unmannedAerialVehicles[i].attackTarget == null)
|
||||
{
|
||||
SendMsg(attackColliders1[i].transform);
|
||||
_unmannedAerialVehicles[i].AttAck(attackColliders1[i].transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue