Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
c101565f8a
|
@ -327,61 +327,61 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 激光发起攻击
|
///// 激光发起攻击
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public void Laserattack()
|
//public void Laserattack()
|
||||||
{
|
|
||||||
if (Receivingdistance > 0 && targetPoint != null)
|
|
||||||
{
|
|
||||||
Collider[] colliders = Physics.OverlapSphere(transform.position, Receivingdistance);//检查是否在打击的范围内
|
|
||||||
for (int i = 0; i < colliders.Length; i++)
|
|
||||||
{
|
|
||||||
if (colliders[i].gameObject.tag == "WRJ")
|
|
||||||
{
|
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = null;
|
|
||||||
if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
|
||||||
{
|
|
||||||
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
|
||||||
}
|
|
||||||
if (unmannedAerialVehicle != null)
|
|
||||||
{
|
|
||||||
Vector3 Angle = unmannedAerialVehicle.transform.position - transform.position;
|
|
||||||
float Angle1 = Vector3.Angle(Angle, transform.forward);
|
|
||||||
Debug.LogError("角度大小:" + Angle1);
|
|
||||||
if (float.Parse(InterferenceAngle) >= Angle1)
|
|
||||||
{
|
|
||||||
Debug.LogError("角度没有问题进来了" + InterferenceAngle);
|
|
||||||
|
|
||||||
if (Receivingposin == null)
|
|
||||||
{
|
|
||||||
//if (Random.value>0.5f)
|
|
||||||
//{
|
//{
|
||||||
Receivingposin = unmannedAerialVehicle.transform;
|
// if (Receivingdistance > 0 && targetPoint != null)
|
||||||
Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
// {
|
||||||
var nowData = GetSyncData();
|
// Collider[] colliders = Physics.OverlapSphere(transform.position, Receivingdistance);//检查是否在打击的范围内
|
||||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
// for (int i = 0; i < colliders.Length; i++)
|
||||||
isLasings = true;
|
// {
|
||||||
CastRayAndRender();
|
// if (colliders[i].gameObject.tag == "WRJ")
|
||||||
break;
|
// {
|
||||||
|
// UnmannedAerialVehicle unmannedAerialVehicle = null;
|
||||||
|
// if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
||||||
|
// {
|
||||||
|
// unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
// }
|
// }
|
||||||
//else
|
// if (unmannedAerialVehicle != null)
|
||||||
// {
|
// {
|
||||||
|
// Vector3 Angle = unmannedAerialVehicle.transform.position - transform.position;
|
||||||
|
// float Angle1 = Vector3.Angle(Angle, transform.forward);
|
||||||
|
// Debug.LogError("角度大小:" + Angle1);
|
||||||
|
// if (float.Parse(InterferenceAngle) >= Angle1)
|
||||||
|
// {
|
||||||
|
// Debug.LogError("角度没有问题进来了" + InterferenceAngle);
|
||||||
|
|
||||||
|
// if (Receivingposin == null)
|
||||||
|
// {
|
||||||
|
// //if (Random.value>0.5f)
|
||||||
|
// //{
|
||||||
// Receivingposin = unmannedAerialVehicle.transform;
|
// Receivingposin = unmannedAerialVehicle.transform;
|
||||||
// var nowData1= GetSyncData1();
|
// Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
||||||
// _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData1));
|
// var nowData = GetSyncData();
|
||||||
|
// _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||||
// isLasings = true;
|
// isLasings = true;
|
||||||
// CastRayAndRender1();
|
// CastRayAndRender();
|
||||||
// break;
|
// break;
|
||||||
|
// //}
|
||||||
|
// //else
|
||||||
|
// //{
|
||||||
|
// // Receivingposin = unmannedAerialVehicle.transform;
|
||||||
|
// // var nowData1= GetSyncData1();
|
||||||
|
// // _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData1));
|
||||||
|
// // isLasings = true;
|
||||||
|
// // CastRayAndRender1();
|
||||||
|
// // break;
|
||||||
|
|
||||||
|
// //}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetSyncData1()
|
private string GetSyncData1()
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,6 +140,7 @@ public class RadarManger : MonoBehaviour
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon.isPlayer)
|
||||||
RetrievalUAV();//看向无人机
|
RetrievalUAV();//看向无人机
|
||||||
}
|
}
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
|
|
Loading…
Reference in New Issue