Compare commits
2 Commits
446def5122
...
8fc4766bae
Author | SHA1 | Date |
---|---|---|
|
8fc4766bae | |
|
d911387140 |
|
@ -145,6 +145,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
/// 激光火炮打击时间
|
||||
/// </summary>
|
||||
public static float lasertime;
|
||||
public float lasertimes;
|
||||
/// <summary>
|
||||
/// 判断物体是否在相机里面
|
||||
/// </summary>
|
||||
|
@ -187,6 +188,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
|
||||
void Update()
|
||||
{
|
||||
if (lasertime>0)
|
||||
{
|
||||
lasertime -= Time.deltaTime;
|
||||
}
|
||||
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
|
||||
//{
|
||||
// if (!EventSystem.current.IsPointerOverGameObject())
|
||||
|
@ -195,6 +200,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
// Front = true;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
|
@ -298,6 +304,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
case "储能间隔时间:":
|
||||
StorageIntervalTime = weaponitemone[i].para_value;
|
||||
lasertime = float.Parse(StorageIntervalTime);
|
||||
lasertimes = float.Parse(StorageIntervalTime);
|
||||
break;
|
||||
case "毁伤目标累积作用时间:":
|
||||
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
||||
|
@ -549,6 +556,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||
OuterLaserlineRenderer.SetPosition(1, LaserPoint.transform.position); // 设置线段终点为目标点
|
||||
}
|
||||
if (lasertimes!=0)
|
||||
{
|
||||
lasertime = lasertimes;
|
||||
}
|
||||
isLasing = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ public class RadarManger : MonoBehaviour
|
|||
/// <summary>
|
||||
/// 计时火炮蓄能时间
|
||||
/// </summary>
|
||||
public float radartime;
|
||||
public float radartime=0;
|
||||
void Start()
|
||||
{
|
||||
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
||||
|
@ -305,19 +305,18 @@ public class RadarManger : MonoBehaviour
|
|||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||
if (unmannedAerialVehicle)
|
||||
{
|
||||
radartime += Time.deltaTime;
|
||||
if (radartime>=LaserFireControlPlatformManger.lasertime)
|
||||
if (radartime == LaserFireControlPlatformManger.lasertime)
|
||||
{
|
||||
Debug.Log("今来了");
|
||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false));
|
||||
radartime = 0;
|
||||
if (laserFireControlPlatformManger)
|
||||
if (laserFireControlPlatformManger)
|
||||
{
|
||||
laserFireControlPlatformManger.isLasing = true;
|
||||
//Debug.Log(laserFireControlPlatformManger.transform.name + "攻击无人机: " + unmannedAerialVehicle.transform.name);
|
||||
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||
laserFireControlPlatformManger.Crosshair();
|
||||
laserFireControlPlatformManger.Lasing();
|
||||
radartime = 0;
|
||||
}
|
||||
}
|
||||
number++;
|
||||
|
|
Loading…
Reference in New Issue