This commit is contained in:
yulong 2024-03-28 14:08:11 +08:00
parent eedc7a9cac
commit 071fe49e58
3 changed files with 53 additions and 39 deletions

View File

@ -1486,8 +1486,8 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 3.1049147, y: 0.9711163, z: 3.155058}
m_Center: {x: 0.060157776, y: 1.1136094, z: 0.13353431}
m_Size: {x: 3.6864724, y: 1.2080312, z: 3.8562632}
m_Center: {x: 0.09509891, y: 1.1254551, z: 0.1453805}
--- !u!114 &4138683085727570685
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -158,6 +158,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
/// 判断物体是否在相机里面
/// </summary>
public bool ispcamera;
/// <summary>
/// 激光武器攻击时间
/// </summary>
public static float timer;
void Start()
{
equipmentCommon = GetComponent<EquipmentCommon>();
@ -225,6 +229,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
StorageIntervalTime = weaponitemone[i].para_value;
lasertime = float.Parse(StorageIntervalTime);
storageIntervalTime = float.Parse(StorageIntervalTime);
timer = storageIntervalTime;
break;
case "毁伤目标累积作用时间:":
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
@ -234,7 +239,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
Receivingdistance = float.Parse(InterferenceDistance) * 1000;
break;
case "干扰角度":
case "瞬时视场":
InterferenceAngle = weaponitemone[i].para_value;
break;
default:
@ -275,7 +280,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
ispcamera = (pos.x > 0 && pos.x < 1 && pos.y > 0 && pos.y < 1 && pos.z > 0);
if (Vector3.Distance(targetPoint.position, transform.position) < Receivingdistance && ispcamera)
{
Debug.LogError("出现在摄像机视角里面了");
Debug.Log("出现在摄像机视角里面了");
Vector3 cector = targetPoint.position - transform.position;
float angle = Vector3.Angle(cector, transform.forward);
if (float.Parse(InterferenceAngle) > angle)

View File

@ -222,9 +222,15 @@ public class RadarManger : MonoBehaviour
while (true)
{
//Debug.Log("Timer fired at: " + Time.time);
yield return new WaitForSeconds(5); // 等待一段时间后继续执行
if (LaserFireControlPlatformManger.timer>0)
{
yield return new WaitForSeconds(LaserFireControlPlatformManger.timer); // 等待一段时间后继续执行
RetrievalUAV();
}
//Deadzone();
}
}
@ -335,7 +341,9 @@ public class RadarManger : MonoBehaviour
{
for (int i = 0; i < targets.Count; i++)
{
UnmannedAerialVehicle unmannedAerialVehicle = targets[i].GetComponent<UnmannedAerialVehicle>();
if (targets != null)
{
UnmannedAerialVehicle unmannedAerialVehicle = targets[i].transform.Find("无人机").GetComponent<UnmannedAerialVehicle>();
if (unmannedAerialVehicle)
{
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
@ -360,6 +368,7 @@ public class RadarManger : MonoBehaviour
}
}
}
}
#region
// public List<Collider> colliders = new List<Collider>();