This commit is contained in:
parent
876ee00b44
commit
f1722f5035
|
@ -5,6 +5,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static NetMQ.NetMQSelector;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 微波武器
|
/// 微波武器
|
||||||
|
@ -249,19 +250,30 @@ public class Microwaveweapon : MonoBehaviour
|
||||||
}
|
}
|
||||||
if (wrjList.Count > 0)
|
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)
|
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
|
else
|
||||||
|
|
|
@ -68,6 +68,8 @@ public class RadioAngleView : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (GameObject target in targets)
|
foreach (GameObject target in targets)
|
||||||
|
{
|
||||||
|
if (uavm != null)
|
||||||
{
|
{
|
||||||
Vector3 relativePosition = target.transform.position - uavm.transform.position;
|
Vector3 relativePosition = target.transform.position - uavm.transform.position;
|
||||||
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
|
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
|
||||||
|
@ -75,6 +77,12 @@ public class RadioAngleView : MonoBehaviour
|
||||||
RectTransform rt = point.GetComponent<RectTransform>();
|
RectTransform rt = point.GetComponent<RectTransform>();
|
||||||
rt.anchoredPosition = radarPosition;
|
rt.anchoredPosition = radarPosition;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取符合条件的设备
|
/// 获取符合条件的设备
|
||||||
|
|
Loading…
Reference in New Issue