This commit is contained in:
YangHua 2024-03-07 11:25:19 +08:00
commit 09d29f1446
6 changed files with 95 additions and 87 deletions

View File

@ -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);

View File

@ -472,12 +472,6 @@ public class GameManager : MonoSingleton<GameManager>
}
}
if (uavm)
{
uavm.SetTipsColor();
DroneViewDisplay.Instance.CreateUI(uavm, false);
}
Debug.Log($"<color=yellow>是否是player{data.r3 == GlobalFlag.currentUser.user_id}</color>");
device.GetComponent<EquipmentCommon>().FillInTheData(data.list_para, data);
device.GetComponent<EquipmentCommon>().deviceID = data.id;
@ -485,7 +479,11 @@ public class GameManager : MonoSingleton<GameManager>
{
device.GetComponent<EquipmentCommon>().isPlayer = true;
}
if (uavm)
{
uavm.SetTipsColor();
DroneViewDisplay.Instance.CreateUI(uavm, false);
}
FormationManager.Instance.WhenSpawn();
}

View File

@ -75,7 +75,7 @@ public class HighPriorityTarget : MonoBehaviour
public GameObject gamepos;
void Start()
{
gamepos.gameObject.SetActive(false);
//gamepos.gameObject.SetActive(false);
HighPriorityTargets.Add(this);
Number = HighPriorityTargets.Count.ToString();
buttonreg.onClick.AddListener(() =>
@ -143,28 +143,28 @@ public class HighPriorityTarget : MonoBehaviour
}
}
}
if (Spectrumdetection.Radius > 0)
{
if (gamepos)
{
gamepos.gameObject.SetActive(true);
switch (Spectrumdetection.Radius)
{
case 1:
gamepos.transform.localScale = new Vector3(10, 1, 10);
break;
case 2:
gamepos.transform.localScale = new Vector3(20, 1, 20);
break;
case 3:
gamepos.transform.localScale = new Vector3(30, 1, 30);
break;
default:
break;
}
}
//if (Spectrumdetection.Radius > 0)
//{
// if (gamepos)
// {
// gamepos.gameObject.SetActive(true);
// switch (Spectrumdetection.Radius)
// {
// case 1:
// gamepos.transform.localScale = new Vector3(10, 1, 10);
// break;
// case 2:
// gamepos.transform.localScale = new Vector3(20, 1, 20);
// break;
// case 3:
// gamepos.transform.localScale = new Vector3(30, 1, 30);
// break;
// default:
// break;
// }
// }
}
//}
}
/// <summary>

View File

@ -382,7 +382,7 @@ public class RadarManger : MonoBehaviour
{
colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
minCamera.orthographicSize = detectionRadius;
if (colliders2.Count > 0)
{
for (int i = 0; i < colliders2.Count; i++)
@ -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));

View File

@ -183,6 +183,10 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
/// 地面层数
/// </summary>
public LayerMask Ground;
/// <summary>
/// 改变频谱探测地图上显示点的大小
/// </summary>
public bool boisp = true;
void Start()
{
gamePos.gameObject.SetActive(false);
@ -215,6 +219,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
if (reveal > 1)
{
gamePos.transform.localScale = new Vector3(reveal, 1, reveal);
boisp = false;
}
}
@ -350,68 +355,68 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
}));
}
if (Spectrumdetection.Radius > 0)
if (Spectrumdetection.Radius > 0 && boisp)
{
if (gxWRJCamera && dzWRJCamera)
//if (gxWRJCamera && dzWRJCamera)
//{
// //gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
switch (Spectrumdetection.Radius)
{
gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
dzWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
switch (Spectrumdetection.Radius)
{
case 1:
reveal = 30;
Mapdisplay();
break;
case 2:
reveal = 60;
Mapdisplay();
break;
case 3:
reveal = 90;
Mapdisplay();
break;
case 4:
reveal = 120;
Mapdisplay();
break;
case 5:
reveal = 150;
Mapdisplay();
break;
default:
break;
}
case 1:
reveal = 30;
Mapdisplay();
break;
case 2:
reveal = 60;
Mapdisplay();
break;
case 3:
reveal = 90;
Mapdisplay();
break;
case 4:
reveal = 120;
Mapdisplay();
break;
case 5:
reveal = 150;
Mapdisplay();
break;
default:
break;
}
//}
}
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 +1150,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 +1168,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;

View File

@ -118,7 +118,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
}
/// <summary>
///
/// 其他非无人机设备生成RenderTexture
/// </summary>
/// <param name="deviceID"></param>
/// <param name="camera"></param>