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>
public float speed = 80;
public float speed = 50;
/// <summary>
/// 地面的图层
/// </summary>
@ -112,7 +112,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
});
}
Interferencemode();
Angularrange();
//Angularrange();
}
#region
/// <summary>
@ -265,6 +265,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
{
Collider[] colliders = Physics.OverlapSphere(transform.position, 300);//检索范围
for (int i = 0; i < colliders.Length; i++)
{
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)
{
Debug.LogError("目标出现在范围内");
}
else
{
Debug.LogError("目标没有出现在范围里面");
}
}
}