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