This commit is contained in:
yulong 2024-01-19 15:48:35 +08:00
parent af1f1e48b3
commit 2d60b58a55
2 changed files with 12 additions and 8 deletions

View File

@ -144,7 +144,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
/// <summary>
/// 激光火炮打击时间
/// </summary>
public static float lasertime;
public static float lasertime;
public float lasertimes;
/// <summary>
/// 判断物体是否在相机里面
@ -188,9 +188,13 @@ public class LaserFireControlPlatformManger : MonoBehaviour
void Update()
{
if (lasertime>0)
if (lasertime > 0)
{
lasertime -= Time.deltaTime;
if (lasertime <= 0)
{
lasertime = 0;
}
}
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
//{
@ -312,7 +316,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
case "干扰距离:":
InterferenceDistance = weaponitemone[i].para_value;
Receivingdistance = float.Parse(InterferenceDistance) * 1000;
Receivingdistance = float.Parse(InterferenceDistance) * 500;
break;
case "干扰角度:":
InterferenceAngle = weaponitemone[i].para_value;
@ -392,7 +396,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
{
if (targetPoint != null)
{
LaserModer.transform.DOLookAt(targetPoint.position,0.5f).OnComplete(() =>
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f).OnComplete(() =>
{
@ -412,7 +416,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
{
if (targetPoint != null)
{
camera.transform.DOLookAt(targetPoint.position,0.5f).SetEase(Ease.Linear).OnComplete(() =>
camera.transform.DOLookAt(targetPoint.position, 0.5f).SetEase(Ease.Linear).OnComplete(() =>
{
Debug.LogError("看向进来了");
Launchanattack();
@ -425,7 +429,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
/// </summary>
public void Launchanattack()
{
if (targetPoint != null)
if (targetPoint != null&& Receivingdistance>0)
{
Vector3 pos = camera.WorldToViewportPoint(targetPoint.position);
ispcamera = (pos.x > 0 && pos.x < 1 && pos.y > 0 && pos.y < 1 && pos.z > 0);
@ -556,7 +560,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
OuterLaserlineRenderer.SetPosition(1, LaserPoint.transform.position); // 设置线段终点为目标点
}
if (lasertimes!=0)
if (lasertimes == 0)
{
lasertime = lasertimes;
}

View File

@ -238,7 +238,7 @@ public class RadarManger : MonoBehaviour
break;
case "探测距离:":
DetectionRange = weaponitemone[i].para_value;
detectionRadius = float.Parse(DetectionRange) * 100;
detectionRadius = float.Parse(DetectionRange) * 200;
break;
case "近盲区:":