This commit is contained in:
YangHua 2024-03-22 13:02:18 +08:00
parent 892259e6c7
commit ee2cc737af
1 changed files with 27 additions and 27 deletions

View File

@ -826,38 +826,38 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
/// <summary>
/// 雷达检测无人机身上得RSC
/// </summary>
public void CheckRSC()
{
if (string.IsNullOrEmpty(RCS))
{
float rcs = float.Parse(RCS);
if (rcs <= 0.5 && rcs >= 0.1)
{
StartCoroutine(ShowRadarTips(0.8f, 2));
}
else if (rcs >= 0.5f && rcs <= 1)
{
StartCoroutine(ShowRadarTips(0.4f, 1));
}
}
}
//public void CheckRSC()
//{
// if (string.IsNullOrEmpty(RCS))
// {
// float rcs = float.Parse(RCS);
// if (rcs <= 0.5 && rcs >= 0.1)
// {
// StartCoroutine(ShowRadarTips(0.8f, 2));
// }
// else if (rcs >= 0.5f && rcs <= 1)
// {
// StartCoroutine(ShowRadarTips(0.4f, 1));
// }
// }
//}
/// <summary>
/// 多少时间在对方雷达界面上显示红色标记
/// </summary>
/// <param name="minTime"></param>
/// <param name="maxTime"></param>
/// <returns></returns>
private IEnumerator ShowRadarTips(float minTime, float maxTime)
{
GameObject tips = transform.Find("Minimapwrj").gameObject;
while (true)
{
tips.gameObject.SetActive(false);
float time = UnityEngine.Random.Range(minTime, maxTime);
yield return new WaitForSeconds(time);
tips.gameObject.SetActive(true);
}
}
//private IEnumerator ShowRadarTips(float minTime, float maxTime)
//{
// GameObject tips = transform.Find("Minimapwrj").gameObject;
// while (true)
// {
// tips.gameObject.SetActive(false);
// float time = UnityEngine.Random.Range(minTime, maxTime);
// yield return new WaitForSeconds(time);
// tips.gameObject.SetActive(true);
// }
//}
public LayerMask layerMask = new LayerMask();
/// <summary>
@ -1230,7 +1230,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
unmannedAerialVehicleManages.RemoveAt(i);
}
}
StopCoroutine(ShowRadarTips(0, 0));
//StopCoroutine(ShowRadarTips(0, 0));
OnActivationChanged -= OnActivationChangedHandler;
}