Compare commits

...

4 Commits

Author SHA1 Message Date
yulong f1722f5035 提交 2024-03-31 19:55:10 +08:00
yulong 876ee00b44 Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane 2024-03-31 19:43:50 +08:00
yulong cf4b8d2381 Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
# Conflicts:
#	Assets/Temp/Scripts/Microwaveweapon.cs
2024-03-31 19:43:46 +08:00
yulong f6d183ba69 1 2024-03-31 19:32:37 +08:00
2 changed files with 24 additions and 10 deletions

View File

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

View File

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