This commit is contained in:
yulong 2024-03-31 19:55:10 +08:00
parent 876ee00b44
commit f1722f5035
2 changed files with 36 additions and 16 deletions

View File

@ -5,6 +5,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static NetMQ.NetMQSelector;
/// <summary>
/// 微波武器
@ -249,19 +250,30 @@ public class Microwaveweapon : MonoBehaviour
}
if (wrjList.Count > 0)
{
for(int i=0;i< wrjList.Count; i++)
{
if (wrjList[i] != null)
{
wrjList[i].limitHealth -= Time.deltaTime;
if (wrjList[i].limitHealth <= 0)
{
Debug.Log(wrjList[i].name + wrjList[i].equipmentCommon.deviceID + "被销毁");
var newdata = Aeroplane(wrjList[i].unmannedAerialVehicles[0]);
MyNetMQClient.instance.Send(newdata);
DeviceManager.Instance.RemoveDevice(wrjList[i].gameObject);
Destroy(wrjList[i].gameObject);
}
}
else
{
wrjList.RemoveAt(i);
i--;
}
}
foreach (var item in wrjList)
{
item.limitHealth -= Time.deltaTime;
Debug.Log(item.name + item.equipmentCommon.deviceID + ":" + item.limitHealth);
if (item.limitHealth <= 0)
{
Debug.Log(item.name + item.equipmentCommon.deviceID + "被销毁");
var newdata = Aeroplane(item.unmannedAerialVehicles[0]);
MyNetMQClient.instance.Send(newdata);
DeviceManager.Instance.RemoveDevice(item.gameObject);
wrjList.Remove(item);
Destroy(item.gameObject);
}
}
}
else

View File

@ -69,11 +69,19 @@ public class RadioAngleView : MonoBehaviour
foreach (GameObject target in targets)
{
Vector3 relativePosition = target.transform.position - uavm.transform.position;
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
GameObject point = Instantiate(targetPointPrefab, rawShow.transform);
RectTransform rt = point.GetComponent<RectTransform>();
rt.anchoredPosition = radarPosition;
if (uavm != null)
{
Vector3 relativePosition = target.transform.position - uavm.transform.position;
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
GameObject point = Instantiate(targetPointPrefab, rawShow.transform);
RectTransform rt = point.GetComponent<RectTransform>();
rt.anchoredPosition = radarPosition;
}
else
{
Destroy(gameObject);
}
}
}
/// <summary>