This commit is contained in:
yulong 2023-12-15 20:24:40 +08:00
parent 15286af0bf
commit 5c748f2d46
1 changed files with 17 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
/// <summary> /// <summary>
/// 飞机迫降的速度 /// 飞机迫降的速度
/// </summary> /// </summary>
public float speed = 80; public float speed = 50;
/// <summary> /// <summary>
/// 地面的图层 /// 地面的图层
/// </summary> /// </summary>
@ -112,7 +112,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
}); });
} }
Interferencemode(); Interferencemode();
Angularrange(); //Angularrange();
} }
#region #region
/// <summary> /// <summary>
@ -265,6 +265,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
{ {
Collider[] colliders = Physics.OverlapSphere(transform.position, 300);//检索范围 Collider[] colliders = Physics.OverlapSphere(transform.position, 300);//检索范围
for (int i = 0; i < colliders.Length; i++) for (int i = 0; i < colliders.Length; i++)
{ {
if (colliders[i].transform.tag == "WRJ") if (colliders[i].transform.tag == "WRJ")
{ {
@ -293,6 +294,18 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
} }
} }
} }
Vector3 one = unmannedAerialVehicle.transform.position - transform.position;
float angue = Vector3.Angle(transform.forward, one);
if (float.Parse(InterferenceAngle) >= angue)
{
Debug.LogError("目标出现在范围内");
}
else
{
Debug.LogError("目标没有出现在范围里面");
}
} }
} }
} }
@ -313,10 +326,12 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
if (float.Parse(InterferenceAngle)>=angue) if (float.Parse(InterferenceAngle)>=angue)
{ {
Debug.LogError("目标出现在范围内"); Debug.LogError("目标出现在范围内");
} }
else else
{ {
Debug.LogError("目标没有出现在范围里面"); Debug.LogError("目标没有出现在范围里面");
} }
} }
} }