This commit is contained in:
parent
7e4c70f308
commit
dce760e536
|
@ -251,6 +251,7 @@ public class Microwaveweapon : MonoBehaviour
|
|||
//MQTTManager.instance.SendData(MQTTManager.instance.Planedata, newdata);
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
GameObject game = Instantiate(Destructioneffect, unmannedAerialVehicle.transform);
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
game.transform.localPosition = Vector3.zero;
|
||||
game.transform.SetParent(null);
|
||||
game.SetActive(true);
|
||||
|
|
|
@ -391,7 +391,7 @@ public class RadarManger : MonoBehaviour
|
|||
if (unmannedAerialVehicle)
|
||||
{
|
||||
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
||||
if (isnearBlindArea)
|
||||
if (!isnearBlindArea)
|
||||
continue;
|
||||
attackColliders1.Add(colliders[i]);
|
||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null&& x.isLasing == false&& x.lasertime <= 0));
|
||||
|
|
|
@ -354,8 +354,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
{
|
||||
if (gxWRJCamera && dzWRJCamera)
|
||||
{
|
||||
gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
||||
dzWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
||||
//gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
||||
|
||||
switch (Spectrumdetection.Radius)
|
||||
{
|
||||
case 1:
|
||||
|
@ -383,35 +383,35 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
}
|
||||
}
|
||||
}
|
||||
Judgingdistance();
|
||||
//Judgingdistance();
|
||||
}
|
||||
|
||||
private void Judgingdistance()
|
||||
{
|
||||
RaycastHit hit;
|
||||
//Debug.LogError("调用了");
|
||||
if (Physics.Raycast(transform.position, Vector3.down, out hit))
|
||||
{
|
||||
Debug.Log(hit.distance);
|
||||
if (hit.distance <= 1f)
|
||||
{
|
||||
if (gamemap && gamePos)
|
||||
{
|
||||
gamePos.gameObject.SetActive(false);
|
||||
gamemap.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gamemap && gamePos)
|
||||
{
|
||||
gamePos.gameObject.SetActive(true);
|
||||
gamemap.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
//private void Judgingdistance()
|
||||
//{
|
||||
// RaycastHit hit;
|
||||
// //Debug.LogError("调用了");
|
||||
// if (Physics.Raycast(transform.position, Vector3.down, out hit))
|
||||
// {
|
||||
// Debug.Log(hit.distance);
|
||||
// if (hit.distance <= 1f)
|
||||
// {
|
||||
// if (gamemap && gamePos)
|
||||
// {
|
||||
// gamePos.gameObject.SetActive(false);
|
||||
// gamemap.gameObject.SetActive(false);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (gamemap && gamePos)
|
||||
// {
|
||||
// gamePos.gameObject.SetActive(true);
|
||||
// gamemap.gameObject.SetActive(true);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
///上传日志
|
||||
|
@ -1145,6 +1145,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
if (isMove && positions.Count > 0)
|
||||
{
|
||||
isMove = false;
|
||||
gamePos.gameObject.SetActive(true);
|
||||
gamemap.gameObject.SetActive(true);
|
||||
Vector3 _positions = positions.Dequeue();
|
||||
var nowData = GetSyncData(_positions);
|
||||
MyNetMQClient.instance.Send(nowData);
|
||||
|
@ -1161,6 +1163,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
/// <returns></returns>
|
||||
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
||||
{
|
||||
gamePos.gameObject.SetActive(true);
|
||||
gamemap.gameObject.SetActive(true);
|
||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||
float _time = _distance / FireSpeed;
|
||||
|
|
|
@ -118,7 +118,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 其他非无人机设备生成RenderTexture
|
||||
/// </summary>
|
||||
/// <param name="deviceID"></param>
|
||||
/// <param name="camera"></param>
|
||||
|
|
Loading…
Reference in New Issue